Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I have a table emp , Fields with empname,dnname,dno,salary.
now I want copy distinct salary with all emp detail from emp into new table which is not already exist in database. how would I do this ?

Answers were Sorted based on User's Feedback



I have a table emp , Fields with empname,dnname,dno,salary. now I want copy distinct salary with all..

Answer / prashant

SELECT DISTINCT empname,dnname,dno,salary into New Table
from emp

Is This Answer Correct ?    3 Yes 2 No

I have a table emp , Fields with empname,dnname,dno,salary. now I want copy distinct salary with all..

Answer / b.kumar

WITH CTE
AS
(
SELECT *, ROW_NUMBER() OVER (PARTITION BY SAL ORDER BY SAL) AS ROWID
FROM EMP7
) SELECT * INTO EMP10 FROM CTE WHERE ROWID=1

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

how to delete duplicate rows in sql server2005

7 Answers   Cisco, CTS, HCL, IBM,


How do I delete a sql server database?

0 Answers  


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

0 Answers  


How to get max 100 values from sql server

7 Answers  


What is the use of =,==,=== operators?

0 Answers  


How to delete the duplicate rows from a table in SQL Server ??

3 Answers  


When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?

0 Answers  


what is victor class

0 Answers  


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

0 Answers  


Explain error handling in ssis?

0 Answers  


Accidentally i deleted my table. How can i get that table?

4 Answers  


what is a mixed extent? : Sql server administration

0 Answers  


Categories