JOIN query doesn't work

Creating tables and queries
Post Reply
pizzipie
Posts: 54
Joined: Sat Sep 13, 2008 2:28 am

JOIN query doesn't work

Post by pizzipie »

Code: Select all

SELECT p.first, p.name, c.category, p.sub, p.phone, p.cell, p.email
FROM pdata p 
JOIN cdata c 
ON p.Catid=c.Catid
WHERE p.Catid=2
ORDER BY p.sub, p.first, p.name;
This works fine in MySql but has this error in Base Query:

SQL Status: HY000
Error code: 1000

Syntax error in SQL statement =>

syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE

I don't have a clue as to what is wrong. Please help.

R
Libre Office Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.10
mgroenescheij
Volunteer
Posts: 300
Joined: Thu Apr 23, 2009 10:19 pm
Location: Sydney Australia

Re: JOIN query doesn't work

Post by mgroenescheij »

My first impression is that you need to have double quotes around the fields and table names e.g. SELECT "p"."first", "p"."name"
AOO 4.1.5 on MS Windows 10 Professional & MacOS High Sierra 10.13.5
Please add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
Post Reply