Subject | Re: Update only First 10 problem ? |
---|---|
Author | Lionel |
Post date | 2005-01-26T09:17:47Z |
Sorry, I also write query with ORDER BY and it's the same result,
all the recordings are updated and not only 10 first ones
UPDATE TB_TEST SET COL='123'
WHERE ID_TEST IN (
SELECT FIRST 10 ID_TEST
FROM TB_TEST
ORDER BY ID_TEST ASC)
The subquery return the first 10 records ...
I've write this query with EMS and IBExpert and same result.
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
all the recordings are updated and not only 10 first ones
UPDATE TB_TEST SET COL='123'
WHERE ID_TEST IN (
SELECT FIRST 10 ID_TEST
FROM TB_TEST
ORDER BY ID_TEST ASC)
The subquery return the first 10 records ...
I've write this query with EMS and IBExpert and same result.
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> > Hello, I've a problem with this query :update
> >
> > UPDATE TB_TEST SET COL='123'
> > WHERE ID_TEST IN (
> > SELECT FIRST 10 ID_TEST
> > FROM TB_TEST)
> >
> > ok, that work but all the records are updated and I want to
> > only the first 10 records, there are a other solution or it's abug
> > from firebird ?best) and
> >
> > With stored procedure no problem but I want use SQL Query.
> >
> > I use the last firebird version for linux.
>
> when you say it doesn't work - do you mean that it's unpredictable?
> Please note that SELECT FIRST syntax is totally meaningless (at
> absolutely unpredictable (at worst) without an ORDER BY clause.
> FIRST what? there is not such thing as natural order in Firebird.
> So,... please try again with an order by clause and report back.
> Alan