Sql query problem
-
id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...
!- F - R - I - E - N - D - S -!
-
id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...
!- F - R - I - E - N - D - S -!
adkalavadia wrote:
sorry for posting my question in wrong category...
yes, this is the wrong post... Answer: select person from table_name group by (bar) having count(*) > 1
Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]
-
id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...
!- F - R - I - E - N - D - S -!
you can use select person from [table] group by (bar) having count(*) > 1
-
id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...
!- F - R - I - E - N - D - S -!
I got the solution SELECT person FROM test GROUP BY Person HAVING COUNT( bar ) > 1 thanks....
!- F - R - I - E - N - D - S -!