Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 483 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL error code: 1175 during UPDATE in MySQL Workbench

#21
As stated in previous posts, changing the default settings of the database server will result in undesired modification of existing data due to an incorrect query on the data in a published project. Therefore, to implement such commands as stated in previous posts, it is necessary to run them in a test environment on sample data and then execute them after testing them correctly.

My suggestion is to write a `WHERE` conditional statement that will loop through all the rows in all conditions if an update should work for all rows in a table. For example, if the table contains an ID value, the condition `ID > 0` can be used to select all rows:

~~~sql
/**
* For successful result, "id" column must be "Not Null (NN)" and defined in
* INT data type. In addition, the "id" column in the table must have PK, UQ
* and AI attributes.
*/
UPDATE schema_name.table_name
SET first_column_name = first_value, second_column_name = second_value, ...
WHERE id > 0;
~~~

If the table does not contain an id column, the update operation can be run on all rows by checking a column that cannot be null:

~~~sql
/**
* "first_column_name" column must be "Not Null (NN)" for successful result.
*/
UPDATE schema_name.table_name
SET first_column_name = first_value, second_column_name = second_value, ...
WHERE table_name.first_column_name IS NOT NULL;
~~~
Reply



Forum Jump:


Users browsing this thread:
3 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through