Skip to content
Advertisement

Update query without condition but need to update 90% of records in a table – SQL / SnowFlake

Update query without a condition but need to update a certain percentage of rows in the table for a specific column.

Say I have 100 rows in a table, I want update a specific column based but no specific condition; just that 90% of the records in the table has to have this new value that I want to update.

Any thoughts/ help is really appreciated.

Advertisement

Answer

You can use SAMPLE feature of SNOWFLAKE. Please see an example below.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement