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 |
|
mukesh39
Starting Member
1 Post |
Posted - 2010-05-25 : 09:41:16
|
| Hi,I am facing problem to make query to get different top 4 contracor of difefrent under construction cities who has project status as null(uncomplete) . For example: In this case, there are 2 cities with under construction, so 4 constructors should be 2 for cityID 1007 and 2 for city 1008.tblCity------------------CityIDIDCityNameStatustblContractor----------------------ContractorIDContractNameCityIDtblCityProjects------------------------IDBrokerprojectStatusContractorIDData:------------tblCity==================CityID | CityName | Status999 CW ConstructionComplete1000 CX ConstructionComplete1007 CY UnderConstruction1008 CZ UnderConstructiontblContractor======================ContractorID | ContractName | CityID1 Ca 9992 Cb 9993 Cc 1000 4 Cd 10005 Ce 10076 Cf 10077 Cg 10078 Ch 9999 Ci 100810 Cj 100811 Ck 100812 Cl 100013 Cm 100714 Cn 100815 Co 1007tblCityProjects=====================ID | Broker | projectStatus |ContractorID1 Ba Done 12 Bb Done 13 Bc Done 14 Bd Done 15 Ba Done 26 Bb Done 27 Bc Done 28 Bd Done 29 Ba Null 310 Bb Null 311 Bc Null 312 Bd Null 313 Ba Null 414 Bb Null 415 Bc Null 416 Bd Null 417 Ba Null 518 Bb Null 519 Bc Null 520 Bd Null 521 Ba Null 622 Bb Null 623 Bc Null 624 Bd Null 625 Ba Null 726 Bb Null 727 Bc Null 728 Bd Null 729 Ba Null 930 Bb Null 931 Bc Null 932 Bd Null 9I am facing problem to make query to get different top 4 contracor of difefrent under construction cities who has project status as null(uncomplete) . For example: In this case, there are 2 cities with under construction, so 4 constructors should be 2 for cityID 1007 and 2 for city 1008.Please help me how can I do it?Thank you |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2010-05-25 : 13:27:40
|
Can you explain how tblCityProjects links? Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
|
|
|