Search Postgresql Archives

SQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

I have come across a query that a developer wrote to update a few rows in table, the query did update the two desired rows but also updated the rest of the table with the column value as 'false'.

Update tableA set col1 = null and col2 in (1,2);

The query updated col1 to null for the rows where col2 was either 1 or 2, rest of rows were also updated for col1 to 'false'.
 The above was run without where clause.
Could the experts throw some light on this?

Regards
Vikas Sharma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux