Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Rohit286
Starting Member
2 Posts |
Posted - 2012-03-15 : 05:34:51
|
Hi I have a table, in which i have to count from one field named as AirVendor but i have to count according to the distinct value of BRN(another field in the same table)I tried this query, but dint work, plz help me out as soon as possible.SELECT count(dbo.tbl_Flights.AirVendor ) as FltCount FROM dbo.tbl_Flights where AirVendor in (SELECT Distinct (BRN ) FROM dbo.tbl_Flights)sample output of this table isBRN AirVendor1001 9W1001 9W1002 S21003 6E1004 AI1004 AIexpected output for count(Airvendor) should be 4as BRN is repeated twice, i need to count the airvendor according to the distinct value of BRN |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-03-15 : 05:52:21
|
plz help me out as soon as possibleYou should help us to help you as soon as possible!BRN(another field in the same table)? dbo.tbl_Flights_Details is the same as dbo.tbl_Flights ?Please give table structure, sample data and wanted output to make it more clear. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
Rohit286
Starting Member
2 Posts |
Posted - 2012-03-15 : 06:26:37
|
hi i have added all the information and corrected my question, which u ahd asked me to do. plz reply me back.thanks for ur response |
 |
|
|
|
|