There is a table1 with records (1,2,3,4,5,6) and table2
with records (4,5,6,7,8,9).write a query so as to get the
result as 1,2,3,4,5,6,7,8,9

Answer Posted / john

select * from table1
union
select * from table2

-- Union will give distinct value of both tables

Is This Answer Correct ?    38 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I start and stop sql server?

619


How to delete duplicate rows in sql server?

663


What is a trace frag? Where do we use it?

745


Can we call stored procedure in trigger?

639


What is catalog views?

703






What are number line correlation administrators will use while working with a subquery?

720


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1251


what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

623


How can change procedure in sql server?

619


how would you store your query in an SSRS report or a Database server?

134


What is model database? : SQL Server Architecture

662


What is dynamic cursor in SQL SERVER?

633


What is an inner join?

615


What is PROJECTION Operation?

683


What is the default value of an integer data type in sql server 2005?

654