Oracle sql functions -
i have table column called type
, can have 3 values (name1
, name2
, name3
).
can write query first returns records type
= name1
, rows values name2
, name3
where
clause, can filter them creationdate
instance?
that means, return day 01/01/2000
:
row 'name1' row 'name1' (rest of rows)
id type creationdate 1, 'name1', '2000/01/01' 8, 'name1', '2000/01/01' 18, 'name3', '2000/01/01' 82, 'name2', '2000/01/01' 11, 'name2', '2000/01/01' 12, 'name3', '2000/01/01' 2, 'name1', '2000/01/02' 4, 'name1', '2000/01/02' 98, 'name2', '2000/01/02'
for every day, records of type 'name1' first , rest of types no order.
thank you! udo.
you can order create date type. if need define order of type can use case.
select id, type, creationdate "table" order creationdate asc, case when type = 'name1' 1 else 2 end asc
Comments
Post a Comment