Re: sql query help
On 26 Apr 2006 14:43:02 -0700, hharry wrote:
(snip)
i am trying to construct a query which will return those person's with
more than 1 date of birth
e.g.
person 1 has 2 dates of birth - 01/01/1980 and 15/12/1975
Hi hharry,
SELECT person_id, COUNT(*)
FROM Table1
GROUP BY person_id
HAVING COUNT(*) > 1
--
Hugo Kornelis, SQL Server MVP
.
Relevant Pages
- Re: select field contain chr(10) (Line Feed character) usng T-SQL
... SELECT column1 ... FROM table1 ... Hugo Kornelis, SQL Server MVP ... (microsoft.public.sqlserver.mseq) - Re: Table compare
... If you want to filter on outer (Table1) criteria, ... "Steve C" wrote in message ... >> Dan Guzman ... >> SQL Server MVP ... (microsoft.public.sqlserver.programming) - Re: Compare record count in table1 to qty in table2?
... Here is a query I'm trying to use and, of course, it does not work: ... INNER JOIN Item_Serial ... Hugo Kornelis, SQL Server MVP ... (comp.databases.ms-sqlserver) - Re: Stored Procedure question
... SQL Server MVP ... "rob" wrote in message ... > Within a stored procedure I am doing the follwing... ... > insert into table2 select aa from table1 ... (microsoft.public.sqlserver.programming) - Re: _ID NUMBER
... > CREATE TABLE Table1 (i INTEGER IDENTITY PRIMARY KEY, ... > CREATE TRIGGER trg_Table1 ON Table1 INSTEAD OF INSERT ... > SQL Server MVP ... (microsoft.public.sqlserver.programming) |
|