Ask Your Question

Libreoffice Base query with array

asked 2016-09-16 11:00:46 +0200

tekkkz gravatar image

I want to make a query in libreoffice base where I want to get all elemts where the id is equal to an array of ids.

So i want to get the elements with id 1,2 and 3.

I thought that I can say in the query the Criterion is "= (1, 2, 3)" but this is not working.

How to get this working?

edit retag flag offensive close merge delete


Actually, what you're saying, §where id is equal to an array of ids§=the ID is an array and compared as such, which for first isn't possible, and for second is mostly useless comparison.

rautamiekka gravatar imagerautamiekka ( 2016-09-16 16:38:10 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-09-16 15:51:48 +0200

pierre-yves samyn gravatar image

Hi @tekkkz

You were close... you just have to use the IN operator, e.g.:

SELECT "CustomerID", "FirstName", "LastName" FROM "Customers" WHERE "CustomerID" IN (0, 1, 5)


edit flag offensive delete link more


@pierre-yves samyn - Thank you; I guess I'm not thinking today.

Ratslinger gravatar imageRatslinger ( 2016-09-16 16:01:19 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-09-16 11:00:46 +0200

Seen: 185 times

Last updated: Sep 16 '16