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 archiv

Aw: SELECT subquery problem

2013-02-05 Thread Stefan Kuhn
enstag, 05. Februar 2013 um 15:49 Uhr Von: cl 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,

Re: SELECT subquery problem

2013-02-05 Thread Andrew Moore
gt; done via 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 > An: mysql@lists.mysql.com > Betreff: SELECT subquery problem > De-lurking here.

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