select user_id, user_name, seq, status
from foo
where status='Approve'
union
select user_id, user_name, seq, status
from foo
where status<>'Approve'
and rownum=1
   
  cmiiw,
  firman

aly rmb <[EMAIL PROTECTED]> wrote:
          Hi .....
ada data spt di bawah :

User_id User_name Seq Status
---------------------------------------------------------
1 A 1
1 B 2 Approve
2 C 1
2 D 2
3 E 1
3 F 2 Approve
3 G 3

yg ingin di hasilkan 
1 B 2 Approve
2 C 1
3 F 2 Approve

Klo Statusnya ngga' ada yg Approve, maka Seq = 1 yg akan di tampilkan

Tolong pencerahannya donk ....




Send instant messages to your online friends http://uk.messenger.yahoo.com 

[Non-text portions of this message have been removed]



         

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]

Kirim email ke