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 |
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-08-06 : 08:08:55
|
| Hi, i have two tables it's called ErrorDetails and LevelDetails..Below having the table structure with dataErrorDetailsS_No ErrorID Descri LevelID---------------------------------------1 1 Coding Error 12 2 Testing Error NULL3 3 Review 24 1 Coding Error 35 1 Test Error 06 2 Test 0LevelDetailsLevelID LevelDescription----------------------------0 None1 Functional!2 Release LevelI want the data like below structure... In the ErrorDetailstable Null and 0 are the same in LevelID...ErrorID LevelDescription countIf any body knows the query please tell meThanks & Regards,S.Jess |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-06 : 08:13:47
|
| Select ed.errorid, ld.LevelDescription, count(ed.*) as counting from ErrorDetails as ed inner join LevelDetails as ld on coalesce(ed.LevelID,0)=ld.LevelID group by ed.errorid, ld.LevelDescriptionMadhivananFailing to plan is Planning to fail |
 |
|
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-08-06 : 08:38:11
|
| Hi, Incorrect syntax near '*'.thanks & regards,S.Jess |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-06 : 08:42:22
|
| Select ed.errorid, ld.LevelDescription, count(*) as counting from ErrorDetails as ed inner join LevelDetails as ld on coalesce(ed.LevelID,0)=ld.LevelID group by ed.errorid, ld.LevelDescriptionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|