|
-
Dec 9th, 2003, 12:55 PM
#1
Thread Starter
Frenzied Member
Append 2 Selects? [resolved]
I need to do something like this in MS SQL Server:
Code:
select startdate from classes
append
select startdate from events
which should return the startdates from both tables in one recordset, but does not. I only get the startdates from the classes table, not from the events table.
I think I use to do this in my old Oracle days, does SQL Server have something like it?
Last edited by blindlizard; Dec 9th, 2003 at 11:50 PM.
-
Dec 9th, 2003, 01:38 PM
#2
Hyperactive Member
Code:
SELECT startdate FROM classes
UNION -- use UNION ALL if you want duplicate values listed
SELECT startdate FROM events
HTH
-
Dec 9th, 2003, 07:17 PM
#3
Thread Starter
Frenzied Member
Thanks, that is it. I need to find a list of keywords and their uses.
So, if I use this then I won't have any duplicates in the recordset?
Code:
SELECT distinct startdate FROM classes
UNION ALL
SELECT distinct startdate FROM events
-
Dec 9th, 2003, 11:19 PM
#4
When using UNION, distinct values are automatically selected.
-
Dec 9th, 2003, 11:49 PM
#5
Thread Starter
Frenzied Member
-
Dec 10th, 2003, 05:43 AM
#6
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|