Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What is the syntax for a query to:
Search a table for all rows with a substring X within a certain column,
and replace the column in all the rows found with substring X removed.
Basically, I need to remove html tags that snuck into title sections.
Use the REPLACE() function in an UPDATE query.
UPDATE yourTable
SET title = REPLACE(title, 'substringX', '');
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed yesterday.
Improve this question
i have a table with different names. i can order alphabetically, but i want to order it in different way.
For example: i want 'H' to be the first set of rows in the table, then 'D', then 'A' like that. how to pass this query in mysql?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How should I delete those two rows by using user_email and note_name only?
Please help
thank you
You can use this below delete script-
delete from your_table_name where user_email = 'asdf#....' and note_name = 'adsf'
Note: This will also delete other rows if there any matching for the conditions.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have millions of data in my database table customer. In that, I have the id_token attribute which has value like cus00001 format now I want to change it to ank00001.
What will be the query in rails or mysql to do it for all the data in the database?
You can use simple update query using REPLACE function:
UPDATE `table_name` SET `id_token` = REPLACE(`id_token`, 'ank', 'cus');
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a table named users. I have their email id in email column as "kayal#gmail.com", "suresh#yahoo.com", etc. I need a sql query to save the username(splitted from the email column like kayal, suresh, etc) column in the same existing table. How can I do this?
update users set username="SUBSTRING_INDEX(email, "#", 1)";
This made the trick.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need update query where I can increment value by 1
Edit: Correct answer has been marked. I hope it will help some needy
UPDATE <tablename> SET <fieldname>=<fieldname>+<additional-value> WHERE ...
a query to add a value to a column:
update table
set column=column + your_value
where some_conditions
This is what you want?