[thelist] (SQL) Query with Multi FK's to the same lookup

Drew Shiel ashiel at sportsinteraction.com
Wed May 19 10:33:11 CDT 2004


At 16:02 19/05/2004, Tab Alleman wrote:
> > Frankly, if this were MySQL, at least, I'd redefine all the rating
> > columns to ENUM('Poor','Fair','Average','Good','Excellent'); you'd
> > use your existing numeric insert/update statements but would get a
> > string back on selects...
>
>Hard-coding like this isn't desirable in this case because if I ever
>need to change "Excellent" to "Superior", for instance, I'd have to
>change it in all my SQL queries instead of in the lookup table.

   As I understand it, the SQL queries would remain numeric in all the 
queries, except for SELECTs, when the database would return the relevant 
name/word. If you came to change it, you'd only have to change the field 
type in the database. Or am I missing something?

   Drew.

-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.686 / Virus Database: 447 - Release Date: 14/05/2004


More information about the thelist mailing list