Page 1 of 1

String functions resulting in SQL syntax errors?

Posted: Wed 13 Aug 2014 20:33
by MBray
I have a simple query that has a where clause that needs to examine the first two characters of one of the table fields. For example,

SELECT
myfield1,
myfield2,
myfield3
from
mytable
WHERE
LEFT(myfield, 2) = 'XX'


This results in the following error:

You have an error in your SQL syntax at line 8, column 2: Unexpected symbol 'LEFT'.

Are functions supported? If so, can someone help me understand the syntax problem with the query referenced above?

Re: String functions resulting in SQL syntax errors?

Posted: Thu 14 Aug 2014 10:58
by Shalex
Could you please try using the following query instead?

Code: Select all

SELECT 
myfield1, 
myfield2, 
myfield3 
from 
mytable 
WHERE 
myfield LIKE 'XX%'

Re: String functions resulting in SQL syntax errors?

Posted: Thu 14 Aug 2014 13:56
by MBray
Thanks for the reply, Shalex. Just for my own understanding...are SQL functions not supported? If so, are there certain functions that are supported and others not?

Re: String functions resulting in SQL syntax errors?

Posted: Fri 15 Aug 2014 08:34
by Shalex
The only functions which are supported at the moment are AVG, COUNT, MIN, MAX, SUM.