Re: intersect function
From: Ray Higdon (sqlhigdon_at_nospam.yahoo.com)
Date: 02/20/04
- Next message: Jerry Lee: "cannot select chinese records"
- Previous message: burke: "intersect function"
- In reply to: burke: "intersect function"
- Next in thread: Vishal Parkar: "Re: intersect function"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Feb 2004 22:16:26 -0500
Intersect is for Analysis services, use UNION or UNION ALL to not eliminate
duplicates.
> select id, status, member_type
> from imis.dbo.name n
> where member_record = 1
>
> union
>
> select id, status, member_type
> from imis_2003_q4.dbo.name n
> where member_record = 1
also, from BOL:
The result sets combined using UNION must all have the same structure. They
must have the same number of columns, and the corresponding result set
columns must have compatible data types.
HTH
-- Ray Higdon MCSE, MCDBA, CCNA --- "burke" <anonymous@discussions.microsoft.com> wrote in message news:1298b01c3f73e$44d48fc0$a101280a@phx.gbl... > i just came across the "intersect" function and can't get > it to work. i'm familiar with "union". > > i've copied the example from books online and i get the > following error: > > [Microsoft][ODBC SQL Server Driver]Syntax error or access > violation > > > i've tried to substitute "union" with "intersect" in a > union statement that works and get the following error: > > Server: Msg 156, Level 15, State 1, Line 5 > Incorrect syntax near the keyword 'intersect'. > > heres the sample statement: > select id, status, member_type > from imis.dbo.name n > where member_record = 1 > > intersect > > select id, status, member_type > from imis_2003_q4.dbo.name n > where member_record = 1 > > we're on sql server 2000 > > thanks for any help.
- Next message: Jerry Lee: "cannot select chinese records"
- Previous message: burke: "intersect function"
- In reply to: burke: "intersect function"
- Next in thread: Vishal Parkar: "Re: intersect function"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|