Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SqlHelp

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dno Status
10 null
10 aa
20 null
20 bb
20 cc
30 null

Display REcord that has a null status but has only one record.

output 30 null
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shan,
You need to use a subquery. It is something like this:

select * from table t1
where t1.status is null and 1 =
(select count(*) from table t2 where t1.dno = t2.dno)
[ October 22, 2004: Message edited by: Jeanne Boyarsky ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic