Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 Select Quiery

Author  Topic 

sureshkumar
Starting Member

11 Posts

Posted - 2007-01-18 : 08:02:08
Hi All,

I have Two tables

Table Name : Test1

Name Code
A 1
B 2

Table Name : Test2

Name Code
A 3
B 4

I need to display the record in which any name or code not available in test2 table to be displayed as result

IN the case

My result

A 1
B 2
A 3
B 4

Pls help me

bye


harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-18 : 08:11:42
[code]Select [Name], Code from Test1
Union
Select [Name], Code from Test2[/code]

There seems to be conflict in what you are asking and what you are showing as expected output.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-18 : 09:32:02
Also, this is the forum for WORKING SCRIPTS only.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -