[dba-Tech] MySQL Syntax: Fresh eyes needed

Peter Brawley peter.brawley at earthlink.net
Sat Mar 16 09:23:38 CDT 2013


On 2013-03-16 7:35 AM, Arthur Fuller wrote:
> I've been staring at this expression too long and my eyes are beginning to
> cross:
> <,mysql>
> SELECT
> IF(ISNULL(customers.`Last Name`),customers.Company,CONCAT(customers.'First
> Name',' ', customers.'Last Name')) as 'File As:'
> from `customers`
> </mysql>
>
> Syntax error. The Concat() part works fine in isolation so the problem is
> not there

Need backticks not single quotes round `First Name` and `Last Name`.

PB

-----

>
> TIA,
> Arthur
> _______________________________________________
> dba-Tech mailing list
> dba-Tech at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-tech
> Website: http://www.databaseadvisors.com
>



More information about the dba-Tech mailing list