+= for SQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

+= for SQL

Post by JellyFish »

Like in PHP, is there a += assignment operator in SQL or something equivalent?
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: += for SQL

Post by Darhazer »

[sql]UPDATE TABLE SET FIELD = FIELD + 1;[/sql]
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: += for SQL

Post by JellyFish »

This is the way I'm doing it right now, but I was just wondering if there was another way, one that involves an operator of some kind. I was assuming that an operator would be faster for this, if one exists.
Post Reply