|
|
| No such thing as a small change | |
| PerlMonks |
Re: using fetchrow_hashrefby maverick (Curate) |
| on Dec 30, 2003 at 19:47 UTC ( #317757=note: print w/ replies, xml ) | Need Help?? |
|
Chang your SQL query to read: and then use 'foobar' in the hash ref. Basically, the keys are whatever it thinks the column name is..so if you use 'sum(column)', 'avg(column)' or the like, it names the key that. If you tack on the 'as something_else' after it, you can effectively name the keys whatever you like. This is also handy when you have a join across two tables that have similarily named columns :)
/\/\averick Update: Heh. 3rd fastest keys in the west...
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||