[thelist] SQL and Bad Database design.

rudy r937 at interlog.com
Fri Jul 6 01:00:34 CDT 2001


>    I have one table that contains all the stats.
>    It doesn't have each stat as a separate field.
>    It uses two fields, "stat_id" and "stat_no".
>    Each player can have only one record per stat,
>         but may have up to 15 different stats.

hi michael

where's the player_id, same table?  can you give examples of the values in
stat_id and stat_no?


>For example, the page requires that I extract
>"stat1","stat2","stat3","stat4","stat5" and sort the players in that
>order.  The problem I have at the moment is that I can't seem to get the
>output to sort correctly after the first column.

you want the best-to-worst players for each stat_id?  based on values of
stat_no?

i'm old and slow, and often i gotta see actual data before i can understand
what kind of query is required...


rudy





More information about the thelist mailing list