drbigfresh Posted January 10, 2008 Share Posted January 10, 2008 I am running the following query: select d_list.listname, d_list.created, d_list.id, (select count(id) from d_list_item where d_list.id=d_list_item.listid) as itemcount from d_list where active='Y' and itemcount >0 order by created desc which works, but it keeps returning items with an itemcount of 0, even though it should only show items with an itemc ount > 0 (all of the itemcount numbers are correct though.) It seems that is is just ignoring the 2nd part of the where clause. I've looked at it for over an hour now, and can't figure it out.... Link to comment https://forums.phpfreaks.com/topic/85444-solved-quick-count-question/ Share on other sites More sharing options...
drbigfresh Posted January 10, 2008 Author Share Posted January 10, 2008 Solved it, it should be: .. where active='Y' having itemcount >0 .... Link to comment https://forums.phpfreaks.com/topic/85444-solved-quick-count-question/#findComment-435990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.