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 |
|
srk
Starting Member
4 Posts |
Posted - 2008-12-23 : 01:38:33
|
| i have this query.....SELECT COUNT(Companytable.Serial) as counts , County.County as Country FROM Companytable left JOIN County ON Companytable.CntyCode = County.County group by County.County order by County.Countyit returns Country Number-------- -------- 1996An Chabhain 7Aontroim 13here the first record value is null in db, so it is blank here.i want to show 'Others' as the text for that field..is there any way out?srk |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2008-12-23 : 01:58:45
|
| Hi,Use COALESCE(yourfield,'others')Jai Krishna |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-23 : 02:04:29
|
| SELECT ISNULL(COUNT(Companytable.Serial),'Others') as counts , County.County as Country FROM Companytable left JOIN County ON Companytable.CntyCode = County.County group by County.County order by County.County |
 |
|
|
srk
Starting Member
4 Posts |
Posted - 2008-12-23 : 03:16:51
|
| thank you...that worked.srk |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-23 : 03:26:56
|
welcome |
 |
|
|
|
|
|