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

Which is the latest version of sql server and when it is released?

0 Answers  


How to write a query with a right outer join in ms sql server?

0 Answers  


How to delete exactly duplicate records from a table?

0 Answers  


What are functions

3 Answers  


Can a synonym name of a table be used instead of a table name in a select statement?

0 Answers  


How many types of stored procedures are there in sql server?

0 Answers  


Can sql servers link to other servers?

0 Answers  


Explain use of expression builder.

0 Answers  


What is user defined datatypes and when you should go for them?

0 Answers  


What are the different types of stored procedures?

0 Answers  


What is system stored procedures?

0 Answers  


what is the difference detween pairwise comparison subquary and non pairwise comparison subquary?

2 Answers  


Categories