IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Preference to a row in Cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Mar 14, 2008 12:20 pm
Reply with quote

Hi,
I've three rows in table as

EmployeeName Coveraege

Name1 Accc.Death
Name1 HMS
Name1 Supp.


Name2 Supp.
Name2 HMS

For all employees, i need to fetch "HMS" coverage first and then all the other coverages.

Pl give me some idea..


Thanks,
Anand
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Fri Mar 14, 2008 3:58 pm
Reply with quote

Try out this query..

select EmployeeName,
Coveraege,
Case Coveraege
when 'HMS'
then 1
else
2
end descrip
from table
order by EmployeeName, descrip

Hope this helps..

Prajesh
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
No new posts Multiple rows within Cursor when Coun... DB2 14
No new posts Dynamic cursor name in Cobol program COBOL Programming 1
Search our Forums:

Back to Top