RE: SELECT subquery problem

2013-02-06 Thread cl
You can do: SELECT last_name, first_name, phone, if(pub_email=Y,email,) as email FROM `mydatabasetable` WHERE `current_member` = Y AND `pub_name` = Y ORDER BY last_name ASC Gracias, Carlos. This worked fine! ---Fritz -- MySQL General Mailing List For list archives:

Re: SELECT subquery problem

2013-02-05 Thread Andrew Moore
Try using a CASE construct in the select. Should work for this. A On Tue, Feb 5, 2013 at 3:25 PM, Stefan Kuhn stef...@web.de wrote: You cannot do this. A sql result alwas has the same number of columns in each row. You could have null or in the column, though. This could be done via the