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 attribu…
Tag: mysql
Merge Two JSON array columns in Mysql 8
I am using Mysql (version > 8). I have a table where I am storing unique customer ids for the day in an JSON field as an array. I need to query for all unique customers in last 30 days. I am unable to find an equivalent mysql query for the same. I am using JSON_ARRAYAGG to first merge all
MySQL Domo AWS RDS Connector
I’m having issues connecting Domo to a MySQL database hosted with AWS RDS. Whenever I try to authenticate I get this error: “Failed to authenticate. Verify the credentials and try again. Domo is ready, but the credentials you entered are invalid. Verify your account credentials and try again. Erro…
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’…
SQLAlchemy – How to count distinct on multiple columns
I have this query: I’ve tried to recreate it with SQLAlchemy this way: But this translates to this: Which does not call the count function inline but wraps the select distinct into a subquery. My question is: What are the different ways with SQLAlchemy to count a distinct select on multiple columns and …
Database performance: Split table or keep together
For our project we want to save employees and customer in one or two database tables. The customers have the same columns as the employees (e.g. name, address, language, email,…). The employees on the other side do have additional columns like SocialSecurity Number, bankaccount,… Since the two hav…
How to calculate aggregate on inner join
I have two tables, Post & Comment. Post table contains info about posts & comment table contains the comments data about each post. Below is there structure, I need to take post_id, post_title from post table and total no of comments (using aggregate function count) on each post from comment table &am…
SQL Query Count With JOIN
I’ve the following SQL Query which runs perfectly fine but now i want to calculate the count based on the following scenario: The current Output is: Now i want to show the count like this way: High (Open) – 2 High (Closed) – 0 Medium (Open) – 1 Medium (Closed) – 0 Low (Open) R…
Mysql query for sum two table data by product wise
If I use the below code the sum of sale and purchase product wise perfect but 5 NO product missing because no purchase only sale but I want to show all product. what-ever purchase or sale are zero. If is use below code then result is like below. I don’t know sum of sale and purchase is not perfect. I
Get records in Many to Many query
I have three tables: 1.article – 2.tag – 3.article_has_tags (An article may have many tags). article: tag: article_has_tags: (it contents article & tag primary keys) I need to return the first three articles with all their tags. My query is: But obviously it’s returning: The result I nee…