From: Dan Nelson Date: June 1 2002 12:12am Subject: Re: Column names that contain % List-Archive: http://lists.mysql.com/mysql/110700 Message-Id: <20020601001215.GA91922@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (May 31), David Adam said: > I have a table that includes numerous column names of the form > '%_Dry_Weight' -- that is, they start with a > percent sign. I am unable to query these columns, as mysql returns a > "you have an error in your SQL syntax' > message. When I try to escape the % character with a backslash, the > error persists. If I put the column name in single quotes (e.g., select > '%_Dry_Weight' from xxx) , the syntax is accepted, but the query returns > the column name, rather than the values stored. According to the manual > for 3.23.41 (which I am using), all characters are acceptable in column > names. I am at an impasse - can anyone steer me in the proper > direction? Many thanks! backtics: `%_Dry_Weight` Or use a column name like Pct_Dry_Weight :) -- Dan Nelson dnelson@stripped