Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QUERY COUNT? 1

Status
Not open for further replies.

JeroenB

Programmer
Apr 8, 2001
93
BE
Hi all,

I seem to have a little bit of a problem with this -at first sight- rather simple query; hope someone can help me out...

I would like to do the following; the query must return a list of records for which the value of the LINK field occurs more than twice in the Access table. For instance; in the example below, the query has to return the records with ID 7, 8 and 9, as the value of the LINK field (i.e., 123) occurs three times in the table (instead of two times).

Thanks in advance
Jeroen


ID LINK TITLE

1 232 ....
2 232 ....
3 989 ....
4 989 ....
5 583 ....
6 583 ....
7 123 ....
8 123 ....
9 123 ....


 
select id
, link
, title
from thetable
where link in
( select link
from thetable
group
by link
having count(*) > 2 )

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top