RE: HELP! Select queries for tables that has fields with # characters

2004-01-29 Thread Mike Johnson
From: Howell, Scott [mailto:[EMAIL PROTECTED] I am trying to query a table that has field names with # characters in them. For example a table emp_earn has a field called FILE# I need to do a query where FILE# = 1332, but anything I try errors out. I can't seem to even create a table

Re: HELP! Select queries for tables that has fields with # characters

2004-01-29 Thread Bernard Clement
Hello Howell, See URL: http://www.mysql.com/doc/en/Legal_names.html for the solution. Basically enclose FILE# with `, e.g. where `FILE#` = 1332 Bernard On Thursday 29 January 2004 12:55, Howell, Scott wrote: I am trying to query a table that has field names with # characters in them. For

RE: HELP! Select queries for tables that has fields with # characters

2004-01-29 Thread Howell, Scott
select * from emp where `file#` = 1332; returns ERROR 1054: Unknown column 'file' in 'where clause' -Original Message- From: Bernard Clement [mailto:[EMAIL PROTECTED] Sent: Thursday, January 29, 2004 1:19 PM To: Howell, Scott; Mysql (E-mail) Subject: Re: HELP! Select queries for tables

Re: HELP! Select queries for tables that has fields with # characters

2004-01-29 Thread Bernard Clement
Which version of MySQL are you using? It works for me with version 4.0.15 as shown below: mysql select version(); +---+ | version() | +---+ | 4.0.15| +---+ 1 row in set (0.00 sec) mysql create table temp (`FILE#` integer); Query OK, 0 rows affected (0.00 sec) mysql