MySQL Forums
Forum List  »  New in 4.1: Subqueries

Hi! count function problem.
Posted by: satheesh narayanan
Date: June 17, 2010 01:43AM

here is my tb structure.
CREATE TABLE `test` (
`id` int(2) NOT NULL auto_increment,
`r1` varchar(100) NOT NULL default '',
`r2` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

records are
id r1 r2
1 a s
2 r a
3 a s
4 a y
How do find count(r1) and count(r2) where r1=a, r2=s
output look like this.
count of a in r1(3) count of s in r2 (2)

Options: ReplyQuote


Subject
Views
Written By
Posted
Hi! count function problem.
1761
June 17, 2010 01:43AM


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.