If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Renaming columns generated in query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-11, 10:39
KidCudi KidCudi is offline
Registered User
 
Join Date: Jan 2011
Location: United Kingdom
Posts: 2
Renaming columns generated in query

Hey guys just have a quick question,

Is it possible to change the column names generated by a mySql query ?.

For example I have a MIN(cost) and I want to rename the generated name "MIN(cost)" to say "Minimum Cost"

I hope I've worded that correctly so that you can understand, I apologise if I haven't.

Cheers
Reply With Quote
  #2 (permalink)  
Old 01-16-11, 11:20
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
Code:
SELECT min(cos) as "Minimum Cost" 
FROM your_table
(Note that the usage of the double quotes requires MySQL to run in ANSI mode)
Reply With Quote
  #3 (permalink)  
Old 01-16-11, 11:27
KidCudi KidCudi is offline
Registered User
 
Join Date: Jan 2011
Location: United Kingdom
Posts: 2
That's just what I was looking for, I searched the web but my searches where only giving me "alter" queries.

Thank you very much !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On