How to retrieve uncommon fields from two different tables?

How can i retrieve uncommon fields from two different tables along with the data??? say i have table A and table B and Tbl A has x,y,z fields and Tbl B has x,a,b fields and i have to retrieve y,z,a,b fields from two tables along with the data.

Showing Answers 1 - 12 of 12 Answers

Vipul Shah

  • Sep 18th, 2011
 

Code
  1. SELECT A.y, A.z , B.a ,B.b

  2. FROM TblA A (nolock)

  3. INNER JOIN TblB B (nolock)

  4. ON a.x = b.x

  Was this answer useful?  Yes

pgp

  • May 26th, 2016
 

How to get common fields from two tables without using inner/left outer join and loops...

  Was this answer useful?  Yes

Ade

  • Jun 27th, 2016
 

Code
  1. SELECT Y,Z AS TableA FROM Tbl A A UNION SELECT a,b AS TableB FROM Tbl B

  Was this answer useful?  Yes

Divya

  • Jun 5th, 2017
 

You can try below example query using the 2columns in this query : Select ContactName,FirstName from Customers C, Employees E where C.ContactName not in( E.FirstName)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions