![]() | |
#11
| |||
| |||
|
|
E_US0874 Invalid fetch first n rows value. It must be a positive integer. (Wed Apr 28 08:19:10 2010) If this is the case, then that might make the case for not returning an error for the 'select first 0' where 0 is a constant less persuasive. |
#12
| |||
| |||
|
|
that doesn't mean that [FIRST n] wont have a practical use in the real world. [snip] somesimtes you just have to get the job done... even if it offends the relational purists. |
#13
| |||
| |||
|
#14
| |||
| |||
|
|
that doesn't mean that [FIRST n] wont have a practical use in the real world. [snip] somesimtes you just have to get the job done... even if it offends the relational purists. |
#15
| |||
| |||
|
|
If the <fetch first row count> is omitted the default value is 1, the fetch first row count> must be greater than 0 and a value of less than 1 should raise an exception. |
|
I know, just because it's in the standard doesn't make it right. |
|
As a side note, there are some SQL implementations that do not return a relations and support the <fetch first clause> syntax; so a <fetch first clause> with a <fetch first row count> of 0 returns nothing. |
#16
| |||
| |||
|
|
In practical terms, implementing: SELECT RANDOMLY CHOSEN n ... Is harder to do and more inefficient. (and QA would have to grapple with assuring randomness) What I think we have might be better named: SELECT ARBITRARILY CHOSEN n ROWS ... |
|
[snip]I would have preferred LIMIT TO n ROWS [...]. |
#17
| |||
| |||
|
|
Ian Kirkham wrote: In practical terms, implementing: SELECT RANDOMLY CHOSEN n ... Is harder to do and more inefficient. (and QA would have to grapple with assuring randomness) What I think we have might be better named: SELECT ARBITRARILY CHOSEN n ROWS ... You are quite right about that, and it is in keeping with the boiler-plate code reminding us that session temporary tables PRESERVE ROWS WITH NORECOVERY! *:-) [snip]I would have preferred LIMIT TO n ROWS [...]. Me too!! *But after the ORDER BY clause. -- Roy UK Ingres User Association Conference 2010 will be on Tuesday June 8 2010 Go tohttp://www.iua.org.uk/jointo get on the mailing list. |
#18
| |||
| |||
|
|
I don't feel that SELECT FIRST 0... is an error. It should do what Marty's programmer expected. What do other DBMSs do? |
![]() |
| Thread Tools | |
| Display Modes | |
| |