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 7 years ago.
Improve this question
is it possible to make in phpmyadmin table which will have:
"id, text1, text2, date"
And after "date" it will delete this record automatically?
You can use MySQL Event like this,
mysqli_query("SET GLOBAL event_scheduler = 'ON'");
mysqli_query("CREATE EVENT rec ON DATE() DO DELETE FROM table_name WHERE some_column=some_value;");
Related
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 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 7 years ago.
Improve this question
I'd have to make a SELECT ordering by first a column and then by another column... Is it possibile?
SELECT * FROM table_name ORDER BY colum1, column2
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?