Hi, We have a transaction table that has a field called userid. Each time a user makes a purchase, this table get populated.
I am using the following query to get the no of transactions per user: select userId, count(*) from transactions group by userid I am using the following query to get a list all consumers that purchased just ONCE select userId, count(*) as txn from transactions group by userid having txn=1 how do i modify this query so that it returns the TOTAL number of consumers that made a purchase just once and not a list of userids? Thanks Pinky --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php