[thelist] 2 columns infos in one query ?
Damien COLA
damiencola at wanadoo.fr
Tue Dec 30 04:47:31 CST 2003
Thank you very much,
I have to admit this is handy, and it works.
I really wonder if one day I will understand what is happening when a
query gets executed..
I'd need to do some proper study I guess.
One more quizz :
Is it possible, keeping the query simple, to have blank rows returned
for days that have no entries ?
Cheers,
Damien
-----Original Message-----
Okay, how about this (should work in most db's, I'd think):
select added_date
,COUNT(adID) as nbad
,COUNT(DISTINCT sellerID) as sellercount
FROM table_ad
WHERE added_date >= '$sqldate_from'
AND added_date <= '$sqldate_to'
GROUP BY added_date
ORDER BY added_date
Probably a lot simpler than you thought?
More information about the thelist
mailing list