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...


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 / priestly george varghese

Select Count(*) as Bike_Count, Owmer from <TN> where Bike
in('pulsar','Honda')
group by Owmer having count(*)>1

Is This Answer Correct ?    8 Yes 1 No

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

Answer / anil

select ownername,count(bike) noofbikes from abikes group by ownername having Count(bike)>1

Is This Answer Correct ?    4 Yes 1 No

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

Answer / valibasha

Select owner from table where bike in(‘pulsar’,’Honda’) group by owner having count(*)>=1

Is This Answer Correct ?    7 Yes 5 No

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

Answer / gaurav.verma4210

select count(*) as no_of_vehical,owner from MulBike group by owner having count(*)>=1

Is This Answer Correct ?    1 Yes 0 No

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

Answer / lakshmi narayanan r

CREATE TABLE bikes (bikeID INT, CName VARCHAR(50), BNAME
VARCHAR(50))

INSERT INTO bikes(CName, BNAME) VALUES ('shanker', 'pulsar')
INSERT INTO bikes(CName, BNAME) VALUES ('shanker', 'Honda')
INSERT INTO bikes(CName, BNAME) VALUES ('shanker', 'car')
INSERT INTO bikes(CName, BNAME) VALUES ('Balu', 'pulsar')
INSERT INTO bikes(CName, BNAME) VALUES ('Balu', 'Honda')
INSERT INTO bikes(CName, BNAME) VALUES ('Balu', 'car')
INSERT INTO bikes(CName, BNAME) VALUES ('Shyam', 'pulsar')
INSERT INTO bikes(CName, BNAME) VALUES ('Jaya', 'Honda')
INSERT INTO bikes(CName, BNAME) VALUES ('Deepa', 'car')
INSERT INTO bikes(CName, BNAME) VALUES ('vasu', 'car')


;WITH tmp (RowId, CName) AS (SELECT ROW_NUMBER() OVER
(PARTITION BY CName ORDER BY BikeID ASC) AS RowId, CName
FROM Bikes)
SELECT DISTINCT CName FROM tmp WHERE RowId > 1

Is This Answer Correct ?    1 Yes 0 No

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

Answer / anand

hey thanks a lot, it is working but with slight modification


Select Count(*) as No-Vehicles, owner from table where
group by owner having count(*)>=1

Regards,
Anand

Is This Answer Correct ?    3 Yes 3 No

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

Answer / gangadharrao

select Owner from dbo.[table] where Bike in (select bike
from dbo.[table]) group by owner having 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 / vidhya

select count(*) as no_of_vehical,owner_name from vehicles group by owner_name having 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 / aditya

select name
from ( select name from bikehaving
where drive in ('pulsur',Homda')) xxx
group by name
having name > 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 / rajkumar v

select Owner, COUNT(*) as Total from table_name group by
Owner having COUNT(*)>1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration

0 Answers  


Can we passed multiple recordset(set of records) using a Stored Procedure

2 Answers  


Which is faster statement or preparedstatement?

0 Answers  


What's the difference between DELETE TABLE and TRUNCATE TABLE commands?

9 Answers  


How to use "if ... Else if ... Else ..." Statement structures in ms sql server?

0 Answers  


What is wide table?

0 Answers  


If any stored procedure is encrypted, then can we see its definition in activity monitor?

0 Answers  


Describe how to use the linked server?

0 Answers  


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

0 Answers  


Hello all, I have data like :- year amt 2004 10 2005 20 2006 30 Now i want output as:- 2004 2005 2006 10 30 60 but i have to use here group by on year.So, i need a single query within that i can find.

3 Answers  


How to apply filtering criteria at group level with the having clause in ms sql server?

0 Answers  


If you are working on a SQL database and if suddenly a developer changes the code and your queries results start giving errors,how will you check using a T-SQL query (on system tables) that what has changed in the database.

2 Answers   Microsoft,


Categories