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 provide default values to stored procedure parameters?

0 Answers  


What is excution Plan in sql server

1 Answers   CarrizalSoft Technologies, TCS,


explain what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

0 Answers  


What is scrollable cursor?

0 Answers  


What is the purpose of the model database?

0 Answers  


What is named calculation? : sql server analysis services, ssas

0 Answers  


What is store procedure? How do they work? When do you use?

0 Answers  


What is a partition key?

0 Answers  


Explain sub-query?

0 Answers  


What are the advantages to use stored procedures?

0 Answers   Ernst Young,


How do I partition a table in sql server?

0 Answers  


explain declarative management framework (dmf) in sql server 2008?

0 Answers  


Categories