Using LIMITS with Update statements

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Feb 17 22:46:14 CST 2009


On 2/18/09 5:55 AM, "Antuan Johnson" <amjohnson09 at gmail.com> wrote:

Hi Antuan, 

> I'd like to update only one record from a table with a specific WHERE search
> statement, but the problem is that when I currently execute the code it
> updates all of the matching records not just the top one, is there any way
> around this? 
> 
> Code that I tried to use but didn't work
> Update Set T1= 'Test' Where col1='name' LIMIT 1

There is no such syntax.
It have no sense.

Let Where col1='name'  have found 100 records.
LIMIT 1 - asks to choose single from 100, but which?

Normally, you should write

    UPDATE ... WHERE id = xxx

I.e. You should use KEY field to specify record.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list