Jump to content

[SOLVED] Quick count(*) question....


drbigfresh

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.