NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL Syntax questions

anoland at indigente.net anoland at indigente.net
Thu May 29 14:42:01 EDT 2008


Kristina,
There are 2 good articles on melonfire.com that discuss subselects. You may find them enlightening.


-----Original Message-----
From: "Kristina Anderson" <ka at kacomputerconsulting.com>
Date: Wednesday, May 28, 2008 10:40 pm
Subject: Re: [nycphp-talk] MySQL Syntax questions
To: NYPHP Talk <talk at lists.nyphp.org>Reply-To: NYPHP Talk <talk at lists.nyphp.org>

these two don't take into consideration my conditional statements on 
>the two fields but I get the idea ...thanks
>
>Kristina
>
>> Steve Manes wrote:
>> > Kristina Anderson wrote:
>> >> Tim, with regard to the second query, I wanted the entire row not 
>> >> just the ID...do I need to do two queries to get that?
>> >
>> > Or a subquery:
>> >
>> > SELECT
>> >    *
>> > FROM
>> >    table_foo
>> > WHERE
>> >    id = (SELECT MAX(id) FROM table_foo);
>> >
>> >
>> 
>> select * from table_foo order by id desc limit 1
>> 




More information about the talk mailing list