fallenpegasus: amazon (Default)
[personal profile] fallenpegasus
Why may LIMIT only take a fixed number? Not even a user variable, let alone an expression.

Wouldn't it be useful to set a user session variable that always gets applied as an implicit limit value?

Both of these things could be done in Drizzle.

Date: 2008-07-31 07:59 pm (UTC)
From: [identity profile] elfs.livejournal.com
That's why they pay you the big bucks.

Date: 2008-07-31 08:39 pm (UTC)
From: [identity profile] harrison-fisk.livejournal.com
SQL_SELECT_LIMIT automatically limits results for every query on a session.

SET SQL_SELECT_LIMIT = 1;
SELECT * FROM test.tbl;

Date: 2008-07-31 08:42 pm (UTC)
From: [identity profile] supersnazz.livejournal.com
That doesn't account for two-part LIMIT clauses, which is to say those with both a limit and an offset.

Date: 2008-07-31 08:49 pm (UTC)
From: [identity profile] harrison-fisk.livejournal.com
Why would one want to use a session based offset/limit? I can see a definite use case for limiting all of the time, but not sure why one would want to always use an offset.

Profile

fallenpegasus: amazon (Default)
Mark Atwood

December 2022

S M T W T F S
    123
45678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 18th, 2025 01:31 pm
Powered by Dreamwidth Studios