MySQL Forums
Forum List  »  Newbie

Re: Cannot use COUNT() or user defined columns in select where clause
Posted by: Steffan
Date: April 03, 2005 10:39AM

Oops, the query that works is supposed to be:

SELECT `account`.`id`, `account`.`screenname`, `partychat_host`.`slots`-(COUNT(`partychat_user`.`pid`)-1) as `slots_left`
FROM `account`, `lock`, `partychat_host`, `partychat_user`
WHERE
(
`account`.`id` = `lock`.`userid`
AND
`lock`.`listing` = '0'
AND
`lock`.`listing_self` != '1'
AND
`account`.`confcode` = ''
AND
`partychat_host`.`userid` = `account`.`id`
AND
`partychat_user`.`pid` = `partychat_host`.`pid`
)
group by `partychat_user`.`pid`
ORDER BY `partychat_host`.`date_chat`

Options: ReplyQuote


Subject
Written By
Posted
Re: Cannot use COUNT() or user defined columns in select where clause
April 03, 2005 10:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.