Do you have a Vendors table and EquipmentTypes table that contain names/descriptions associated with codes you are using? If you have those tables, then all you have to do is join to them: SELECT mt.RecordId , v.Name , t.NameFROM mytable mt INNER JOIN vendors v ON mt.vendorid = v.vendorid INNER JOIN EquipmentTypes t ON mt.typeid = t.typeid
Now, if you don't have those tables, you could do all of your "decoding" inside your queries: SELECT RecordId, CASE VendorID WHEN 1 THEN 'Cisco' WHEN 2 THEN 'Bay Networks' ELSE 'Unknown' END, CASE TypeID WHEN 1 THEN 'Switch' WHEN 5 THEN 'Router' ELSE 'Unknown' ENDFROM mytable
But this approach is very inflexible -- every time you decide to add a new vendor or equipment type, you'll have to change your query.