write a query for list of owner who are having multiple
bikes in below table
1 shanker pulsar
2 shanker Honda
3 shanker car
4 Balu pulsar
5 Balu Honda
6 Balu car
7 Shyam pulsar
8 Jaya Honda
9 Deepa car
10 vasu car

Answers were Sorted based on User's Feedback



write a query for list of owner who are having multiple bikes in below table 1 shanker pulsar 2 ..

Answer / madhu sudhan g

Hii guys lets the table is Table_Bikes to get the answer the query is

with CTE(count,name)
AS
(
select count(1) as count,name from Table_Bikes Group By Name
)
select Name from CTE where count>1

Is This Answer Correct ?    0 Yes 0 No

write a query for list of owner who are having multiple bikes in below table 1 shanker pulsar 2 ..

Answer / uttam sing rawat

select distinct Owner_Name from dbo.Tbl_Owner where bike
in(Select distinct bike from dbo.Tbl_Owner)

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More SQL Server Interview Questions

Is truncate a dml command?

0 Answers  


What is history table in sql server?

0 Answers  


What is transaction server auto commit?

0 Answers  


How get current date in SQL server 2000

4 Answers   Cap Gemini, Polaris,


what's the maximum size of a row? : Sql server database administration

0 Answers  






how many instance use in sql server 2005

4 Answers   EFI, HCL,


Can two tables have the same primary key?

0 Answers  


What is the full meaning of dml?

0 Answers  


Write a SQL query to delete a table?

0 Answers   Amdocs,


what is a check constraint?

0 Answers  


What are the basic features of a trigger in ms sql server?

0 Answers  


what are the new features introduced in sql server 2000? : Sql server database administration

0 Answers  


Categories