Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does "decode" function work in SQL Order By clause?

Status
Not open for further replies.

tdrBates

MIS
Nov 22, 2002
60
US
In my SQL Query Command the Order By clause has the "decode" function.

Can someone explain what this function does to the "Sort" below?

ORDER BY
cmta.vw_headway_data.signid,
cmta.vw_headway_data.direction,
Route,
cmta.vw_headway_data.serviceid,
trapeze.linestop.sequence,
cmta.vw_headway_data.nodeid,
decode(cmta.vw_temp_planning_apc_jgovea2.excabbr, 'RPMW', 1, 'RPTH', 2, 'RPDF', 3, '', 4, 'RPSAT',5, 'RPSUN', 6),
DAY,
cmta.vw_headway_data.time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top