Mungkin bisa sy perbaiki perintah querynya menjadi spt :
select User_id,
User_name,
Decode(Status,'Approve',Seq,1) Seq,
Status
from tabel;
tks
----- Original Message ----
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: [email protected]
Cc: [email protected]
Sent: Tuesday, October 23, 2007 5:23:05 PM
Subject: Re: [indo-oracle] Query table
coba saya bantu,
select * from(
select User_id User_name Seq Status from tabel
where status='Approve'
union all
select User_id User_name Seq Status from tabel
where (status is null and seq=1)
) order by User_id
salam,
adhi
aly rmb <[EMAIL PROTECTED] com>
Sent by: indo-oracle@ yahoogroups. com
23/10/2007 15:13
Please respond to
indo-oracle@ yahoogroups. com
To
indo-oracle@ yahoogroups. com
cc
Subject
[indo-oracle] Query table
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