Here's the situation: I have a table named hits with a date column (PHP style, just an integer), and columns for a number of different sites, identified by a siteid which keys to the information for a site in the table sites. The table sites has the columns siteid and name. I'd like to be able to query the table hits and use some sort of AS statement to rename the column names to sites.name where sites.siteid equals the column name. Is this possible? If so, could someone please give me an example? Thanks a lot!
EDIT: Just in case it's relevant, I'm running MySQL.