"Noah Spitzer-Williams" <[EMAIL PROTECTED]> wrote in message
> i have two tables each with a same field and i would like to find which
> table has the bigger value in this field..
> is there a way to do this with one select statement?
> i've tried things like:
> select max(t1.bannerid) as b, max(t2.bannerid) as a,
> IF(t1.bannerid>t2.bannerid,t1.bannerid,t2.bannerid) FROM user_banners as
> user_banners_approve as t2 ORDER BY t1.bannerid DESC GROUP BY t1.bannerid
> but im not having much luck.

Uh... either do a separate select for each table, or find a way to JOIN the

Better than that, if you're doing what it looks like you're doing - keeping
two separate tables, one for approved banners and one for non-approved
one? - make a single "banners" table with an 'approved' field... then it's

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to