I need to modify the LENGTH of text in field in db mysql. I’ve attribute_name that I need to have with max LENGTH 28 characters. WordPress and woocommerce limit this field to 28 characters. Right now my website is down because some taxonomies are too long. There is a way to “cut” all attribute_name <= 28? All my attribute_name should
Tag: sql-update
How to insert values into table based off values of another table in SQL?
So in SQL, I have a table albums that has (album_id, album_name, year) I also have a table songs that has (song_id, song_name, album_name). I used an alter table statement to add a column to songs called album_id For each song that belongs to an album, I want to add its respective album_id to that row I’m not sure how
I’m trying to update the values of a table SQL have an error in Java
I’m trying to update the values of a table, but it throws an error that I have not been able to determine. If you visualize it it would help me, this is what it throws by console: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
How to combine two records while keeping all referencing records?
PostgreSQL 11.1 I have struggled with this problem for a long time. (I have tried to improve the question from before). Problem: A person has two different names in table tempA. Each name has its associated records in table tempB. How can I move all the records associated with one name to the other name, then delete the name? Example:
SQL – Update multiple tables, the same column across one query
I have a postgres database There are 3 tables, I’m trying to make a sql UPDATE statement that updates an active column in each table. Table1 has a field record that looks like this: Table2 Table3 is the same as table 2 I need a query that looks for the name “Digital Only” and it’s ID on table1. Update it’s
MYSQL Update Column with higher values from other table
I’m having two tables in an mysql database. TABLE_A I want to update Table_A with values from Table_B, but only if they are higher. Has anyone a snippet for me? Answer One option uses the update/join syntax: If there are no duplicate ids in table_b, no need for aggregation:
Assign increasing integer values to a column in mysql database
We have an application where we have some learning path and each learning path is associated with some courses. The association between learning path and courses is stored in a mysql table. Now we also want to store course position in learning path to course mapping, so I have added another column ‘position’ in the table and I want to
Dynamic update query for multiple columns using spring MVC
I am having a JSON data as shown below: I need a query to be executed and should be in the below form I am using Spring MVC for processing this and the code I wrote is as follows. It is not complete. It would be very much helpful if someone could help me out here. Thanks in advance. Answer
check for same range in postgresql
I wanted to check if for one particular student my column (Amount) contains a value less than 10, and if yes, then check if for the same student my column (Amount) is also greater than 10 and update the column new accordingly in PostgreSQL. MY table: Tried this way but not working The output I’m expecting: Answer One option is
Update SQLite column with text of maximum length from same row
I have an (Android) SQLite table with two columns, Col1 and Col2, containing text. I want to update Col1 to contain the text with the maximum length out of Col1 and Col2 from the same row. I already have a working query but that query takes pretty long to execute on a large data set. Example data: Expected update result: