Just to offer an alternate.

Instead of those time consuming case statements and joins, you could
just add a new table to assign a sort order value to each of the
Types, such as you said the table would look like this

1 - RMA
2 - LOC
3 - H

Where the numeric value would be the type's ordering ID

Then you could do a simple query with a basic join off of this table,
order by it and only take the top record. This would be the "simplest"
approach to solving the problem, but only if you can add another
table.

<cfquery>
SELECT DISTINCT TOP 1
   pseason.id
   ,pseason.addr_type
   ,pseason.person_addresses
FROM
   PSeason INNER JOIN RoomTypes ON PSeason.addr_type = RoomTypes.addr_type
WHERE
   pseason.id = '0000133'
ORDER BY
   RoomTypes.OrderID
</cfquery>


-- 
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:282509
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to