Tim Dudgeon wrote:
>
>
> Bernt M. Johnsen wrote:
>
>> Tim Dudgeon wrote:
>>
>>>
>>> Yes, but is there an equivalent to the TOP or LIMIT keywords that other
>>> databases use?
>>
>>
>> Not in SQL (neither in Derby nor the SQL standard).
>> The closest equivalent is Statement.setMaxRows(i).
>>
>
It would be great if Derby had TOP (as in SQL Server) and LIMIT (as in
MySql), because DataSet does not allow setMaxRows. TOP and LIMIT should
support variables:
@Select("SELECT TOP ?1 * FROM Users WHERE Pin IS NULL")
DataSet getWithoutPin(int top);
-- Harri
Tim Dudgeon wrote:
Bernt M. Joh
Bernt M. Johnsen wrote:
Tim Dudgeon wrote:
Yes, but is there an equivalent to the TOP or LIMIT keywords that other
databases use?
Not in SQL (neither in Derby nor the SQL standard).
The closest equivalent is Statement.setMaxRows(i).
So that would not be applied at the query level?
State
Tim Dudgeon wrote:
>
>
> Marl Atkins wrote:
>
>> This would only work if the ID field is an Identity.
>> As it happens, it IS so this should work for me too.
>>
>> THREE answers to my problem.
>> You guys are good THANKS!!
>
>
> Yes, but is there an equivalent to the TOP or LIMIT keywords tha
Marl Atkins wrote:
This would only work if the ID field is an Identity.
As it happens, it IS so this should work for me too.
THREE answers to my problem.
You guys are good THANKS!!
Yes, but is there an equivalent to the TOP or LIMIT keywords that other
databases use?
Tim
On 9/14/06, Marl Atkins <[EMAIL PROTECTED]> wrote:
This would only work if the ID field is an Identity.As it happens, it IS so this should work for me too.THREE answers to my problem.
That's one of the nice aspects of Open Source
You get Open Assistance :) or Open Support however you want to call
Subject: Re: Top 1 - Limit 1
I think the IDENTITY_VAL_LOCAL() function is what Marl is actually looking
for. http://db.apache.org/derby/docs/10.1/ref/rrefidentityvallocal.html
Dan
On 14/09/06, Bernt M. Johnsen <[EMAIL PROTECTED]> wrote:
> Marl Atkins wrote:
> > Hi:
> >
>
Yes, highest ID = it's an Identity field.
It looks to me like either would work.
Any idea which has a better performance?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 8:04 PM
To: Derby Discussion
Subject: Re: Top 1 - Li
I think the IDENTITY_VAL_LOCAL() function is what Marl is actually
looking for. http://db.apache.org/derby/docs/10.1/ref/rrefidentityvallocal.html
Dan
On 14/09/06, Bernt M. Johnsen <[EMAIL PROTECTED]> wrote:
Marl Atkins wrote:
> Hi:
>
> I'm searching the docs and can't find it.
> Is there a way
Marl Atkins wrote:
> Hi:
>
> I'm searching the docs and can't find it.
> Is there a way to limit the number of records in the result like:
>
> Sql Server: Select Top 1 * From MyRecs ORDER BY ID DESC
> MySql:Select * From MyRecs ORDER BY ID DESC LIMIT 1
>
> Basically, I need the ID of the
Hi:
I'm searching the docs and can't find it.
Is there a way to limit the number of records in the result like:
Sql Server: Select Top 1 * From MyRecs ORDER BY ID DESC
MySql: Select * From MyRecs ORDER BY ID DESC LIMIT 1
Basically, I need the ID of the last record inserted.
How can I get that?
11 matches
Mail list logo