Michael Baranov wrote:
Hi!
I'm using OO 2.3.0 on Ubuntu Gutsy and building a little private accounting DB. The engine is embedded HSQLDB. However, I came across a problem : I can't make TOP/LIMIT to work with queries. Tried all sane and insane combinations like:
SELECT TOP 3 * FROM ...
SELECT * FROM ... LIMIT 3
SELECT LIMIT 3 * FROM ...
etc. etc.

Any clues? Thank you!!!
Hi Michael,

The short answer:

You will need to run these queries direct - meaning, in the query design window after turning off the GUI designer and adding your TOP or LIMIT comamand you must then click on the tool button 'Run SQL direct' It is a graphic of the letters SQL with a green check mark on the right of the toolbar ( in the default icon set ).

Following are all valid uses of the commands:

SELECT TOP 3 * FROM "Tasks" ORDER BY "StartDate" SELECT LIMIT 3 2 * FROM "Tasks"
SELECT * FROM "Tasks"  ORDER BY "StartDate"  DESC LIMIT 3
SELECT * FROM "Tasks"  ORDER BY "StartDate"  DESC LIMIT 3 OFFSET 2
SELECT TOP 3 * FROM "Tasks"  ORDER BY "StartDate"  DESC

Following are INVALID statemsnts

SELECT * FROM "Tasks" LIMIT 3
SELECT * FROM "Tasks"  ORDER BY "StartDate"  DESC TOP 3
SELECT LIMIT 3 * FROM "Tasks"

One thing to keep in mind is that the different queries do not return the same result sets.

So - for the long answer a bit more explanation with an example really makes sense
- The wiki ro the forum..hmmm..
OK - I suppose the wiki

Just created a decent example dataset ( used for queries above ) and have started updating the page at http://wiki.services.openoffice.org/wiki/Built-in_functions_and_Stored_Procedures#Modifiers

I'll post here when that is finished.

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to