MySQL Forums
Forum List  »  Newbie

Re: Conditional SELECT - is it possible?
Posted by: Paul A
Date: December 09, 2012 02:58PM

Thanks - in fact I just want a single column "Year." Example output, I now get (apologies for the format, how do you add <pre></pre> in this forum?):

+---------+------+-------+-------------+
| Barcode | Year | Year2 | Description |
+---------+------+-------+-------------+
|1MILI121 | 1950 | | g/none |
|1AERO121 | | 1983 | vg/g |
|1RAIL120 | 1920 | | fair/none |
+---------+------+-------+-------------+

and just want to make 1983 appear as "Year" without a "Year2" column:

+---------+------+-------------+
| Barcode | Year | Description |
+---------+------+-------------+
|1MILI121 | 1950 | g/none |
|1AERO121 | 1983 | vg/g |
|1RAIL120 | 1920 | fair/none |
+---------+------+-------------+

I tried your suggestion and still get the same output, because the db is designed for other uses of the diff year/year2 (it can be an "either/or" usage) -- I just don't need it for this output, so have to open the data in an oOo spreadsheet and "combine" the columns.

Again, many thanks - Paul



Edited 1 time(s). Last edit at 12/09/2012 03:02PM by Paul A.

Options: ReplyQuote


Subject
Written By
Posted
December 09, 2012 01:43PM
Re: Conditional SELECT - is it possible?
December 09, 2012 02:58PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.