Skip to content

Tag: mysql

Update field with a shorter string

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…

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 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) &#82…

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…