Retreive data from 2 tables

I have 2 tables. Table A and Table B. I want to display all the rows from both the tables. can anyone help me on this??

Showing Answers 1 - 9 of 9 Answers

Nikhil Gupta

  • Aug 16th, 2015
 

Code
  1. SELECT * FROM Table_a union SELECT * FROM Table_b;

It will display all the records present in both tables.

Thanks,
Nikhil Gupta

  Was this answer useful?  Yes

YK

  • Sep 4th, 2015
 

Use Union ALL

  Was this answer useful?  Yes

isha

  • Sep 5th, 2015
 

UNION or UNION ALL can be used if all column names are same in both the tables... else use join condition to retrieve data from both the tables if the tables have at least one common column

  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