[SOLVED] using CONCAT on 'as' fields |
2/11/2012 04:46:06 | |
| PHPRunner General questions | ||
|
M
miles authorDevClub member
Hi i am trying to get a field in my SQL which incorporates some 'calculated' fields. is this possible? |
||
|
|
Sergey Kornilov admin 2/11/2012 |
|
Some databases won't allow you to use aliases when you define a new calculated field. Use a full calculated field specification instead i.e. CONCAT(if(Nursing="YES", 'Nursing', ''), ', ', if(AD=1, 'Alcohol Dependancy ', ''), ', ', if(D=1, 'Dementia', '') ) AS CHspec, |
|
|
M
|
miles authorDevClub member 2/12/2012 |
|
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=64285&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> Thanks a bunch Sergey, you are a genius! this one is solved! |
|