Skip to content

Tag: mysql

how to extract and zip values from json with SQL, mysql

I struggle to extract the required values from the JSON column in MySQL. Imagine the variable: and I need to extract and return a new JSON array containing only selected key-value pairs, eg.: only a’s and b’s and if the required key does not exist I want to return null for that key: thanks Answer Here’s a solution using MySQL

How merge these two sql queries in mysql?

I want to merge below two queries and display two count based on the condition of each band name but I am not getting any clue. Can anyone help me, please? Thanks Answer I mean I want to have two-column of count ids The requirements are not clear at all and I had originally typed a separate answer, but

SQL query with meta_key,meta_value and have 2 conditions

I am trying to do an SQL query to find a form id of the Registration form of the user on a wordpress site, because this form doesn’t have the id of the user yet, I have to find the user email which is unique and check if the gdprchekbox-1 is true because it is only used for the registering

SQL how do I sum up a has many relationship

So I have the following table, I managed to join users and membership tables just fine with a left join however I’ve been unsuccessful at summing up the individual customers’ total. Here’s my code, the one-to-one associations seem to be doing fine however the summing up of the total seems to not display, what am I doing wrong? is there

How to get distinct parent_sku count for the below dataset?

Need your help to extract distinct Parent_sku count from the below data set. Condition: If one child of a parent_sku has “High” sales_tag then that parent_sku count should be excluded from “Low” sales_tag. P.S. Sales_tag column is based on child_sku column. Thank you for your help. Dateset_&_Output Answer The presented schema is non-conducive to this type of query, however we

Percentage based on another column, with group by

This is what I have: getting this one: I want to have additional column, telling me per day how much is my success rate. E.g. 210/(210+40) for day 5, 40/(32+40) for day 6 etc: Answer This way you can get the rates (success/failure) for equivalent status type. Output: