|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question about HAVING clause
Hello,
I'm working on this query that's supposed to give me a list of registered user's last_name, first_name, id and also the count on the number of visits during a time period: Quote:
However, if I change the count(*) >= 2 to be count(*) > 20 for example, it gives me the same rows as would >=2. I would appreciate any insight. Thanks very much! |
|
#2
|
||||
|
||||
|
Quote:
tie the two tables together in this subquery: Quote:
|
|
#3
|
|||
|
|||
|
Quote:
Hm.. after testing your proposed solution, it doesn't seem to change the results. ie. >=2 still gives results that have a frequency = 1.... But thanks a lot for your response, pickledshark ![]() |
|
#4
|
|||
|
|||
|
When you say frequency, is this a column? or is this the number of records in the table 'trail' for a given person?
|
|
#5
|
|||
|
|||
|
It is a column in the results table, coming from the count(*) query. But in other words, yes: the number of records in the table 'trail' for a given person record in the person table.
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Question about HAVING clause |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|