-
-
Save anonymous/ba66de593b98ad0d6e4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql (9.4.1) | |
Type "help" for help. | |
test=# create table bug_or_feature (id bigserial not null primary key, foo text not null); | |
CREATE TABLE | |
test=# insert into bug_or_feature (foo) values ('bar'); | |
INSERT 0 1 | |
test=# insert into bug_or_feature (foo) values ('bar'); | |
INSERT 0 1 | |
test=# insert into bug_or_feature (foo) values ('bar'); | |
INSERT 0 1 | |
test=# update bug_or_feature set foo = 'baz' from (select id from bug_or_feature where foo = 'bar' limit 1) as yada; | |
UPDATE 3 | |
test=# select * from bug_or_feature; | |
id | foo | |
----+----- | |
1 | baz | |
2 | baz | |
3 | baz | |
(3 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment