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:

SELECT subquery problem

2013-02-05 Thread cl
De-lurking here. I am trying to figure out how to return results from a query. What I need to do is to return 4 columns from a database. This is easy: SELECT last_name, first_name, phone, email FROM `mydatabasetable` WHERE `current_member` = Y AND `pub_name` = Y ORDER BY last_name ASC This

Re: SELECT subquery problem

2013-02-05 Thread Andrew Moore
the if(,,)-statement of mysql or by using a union and two selects, one for pub_email=n and the other for the rest. Gesendet: Dienstag, 05. Februar 2013 um 15:49 Uhr Von: cl c...@nimbleeye.com An: mysql@lists.mysql.com Betreff: SELECT subquery problem De-lurking here. I am trying to figure out

Aw: SELECT subquery problem

2013-02-05 Thread Stefan Kuhn
. Februar 2013 um 15:49 Uhr Von: cl c...@nimbleeye.com An: mysql@lists.mysql.com Betreff: SELECT subquery problem De-lurking here. I am trying to figure out how to return results from a query. What I need to do is to return 4 columns from a database. This is easy: SELECT last_name, first_name, phone