1

So the following query works fine for me:

SELECT DISTINCT StNo,HaulNo,CatCatchWgt 
FROM HL 
WHERE SpecCode='126436';

But, when I try to add another column to my selection, like so:

SELECT DISTINCT StNo,HaulNo,Year,CatCatchWgt 
FROM HL 
WHERE SpecCode='126436';

Suddenly, I get errors. Specifically, when I open the details I get:

HY000 error code 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE

However, when I go to the W3 schools SQL website and try to query 4 columns (http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all), it works fine. Does OpenOffice Base hate it when you try to query too many columns? Do I have to do something special in OpenOffice? Or am I forgetting some key concept?

  • 1
    Most likely `Year` is a reserved word in OpenOffice base. Try use quoted identifiers (I am not sure what are the escape symbols for Openoffice, find out yourself) – cha Feb 06 '14 at 05:16

0 Answers0