[thelist] SQL and Bad Database design.

Michael Pemberton mpember at phreaker.net
Thu Jul 5 23:01:16 CDT 2001


I have recently been asked to put together a sport stats page the is
getting the figures from a live db during the game.  I have to somehow
get around the bad design that has been implemented by the existing
system.

I am not allowed to modify the db structure because it is closely tied
to the custom software that they use.

Here's the problem:
    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.

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.

Does anyone have any ideas on how I can get around this?

<aussies> The stats are from an AFL match and are goals, behinds,
handballs, kicks, marks. The page will eventually look like a Channel 7
stat page. </aussies>
--
Michael Pemberton
mpember at phreaker.net
ICQ: 12107010






More information about the thelist mailing list