Page 1 of 1

[Solved] SQL Delete Records from range

Posted: Fri Mar 21, 2025 11:36 pm
by MPEcho
Greetings All,

I have a functioning database. Its a split database with HSQLDB,

I was attempting to copy the "people" table using the Base GUI to create empty table "people2". Accidentally copied the entire table back to itself. I've identified the duplicate records, within a range of field 'pid'.

Can anyone advise a SQL command to delete records in a range?

I tried ( using Tools | SQL in Base )
DELETE FROM 'people'
where 'pid' between 641 and 1213

the return I get is: "unexpected token: people : line: 2 at ./connectivity/source/drivers/jdbc/Object.cxx:173

Feels like I'm missing something obvious. Thanks in advance

Re: SQL Delete Records from range

Posted: Sat Mar 22, 2025 12:34 am
by FJCC
The names of tables and columns should be in double quotes

Code: Select all

DELETE FROM "people"
where "pid" between 641 and 1213

Re: SQL Delete Records from range

Posted: Sat Mar 22, 2025 2:14 am
by MPEcho
FJCC wrote: Sat Mar 22, 2025 12:34 am The names of tables and columns should be in double quotes

Code: Select all

DELETE FROM "people"
where "pid" between 641 and 1213
Where is the "DOH!" imoji?! I knew I was missing something.