Skip to content

mysql – Search for a key within inconsistent json structure

I know of the functions such as: JSON_SEARCH() and JSON_EXTRACT() etc. This issue is that I am searching for a key in a json string that is not standardized. for example: and the results could be something like this: so in this example I want to get john doe with the acctNum of 123. but, also, the location of…

Dynamic columns from two tables

i need some help. I would like to combine two tables in sql with dynamical columns. Here my thoughts: Table one: Example Table jrincidents Table two: Example Table jrusers reporting like i don’t know how to dynamically add the steplabels from table jrincidents as columns of jrusers if where processname …

How can I group a joined query with linq

I’m trying to produce a data set for a graph that would get me the same result as the following SQL query: But if I try to translate it into a linq query, I can’t get the same result, I either don’t have access to one or the other side of the junction, or I get a yearly total of

Finding a phone number by entering a string SQL

I want to find the phone number in the database by entry into the string, while I wrote this. But if, for example, the number starts with +3 and not only with +7. Any help would be welcome. in SQL I am newbie For example, there is a Users table with a phone column. There are numbers starting at +

The difference between two values from different rows grouping by column

Let’s say there is a table jd_log: What im trying to do, is to find the difference between 2 durations (as duration_diff) for each unique job_name. It is guaranteed, that for each unique job_name there will be no more than 2 entries in the table with such job_name. If there is only 1 entry for specific …

Getting total from query of individual groups

I’ running a query that returns total count of offices per county. and my results look like this: Is there a way to get the total count returned in the same query? Answer If you want it as a column, use a window function: If you want it as an additional row, then use WITH ROLLUP:

SQL Query from getting SubChild to Child to Parent Tables

Good day, I’m trying to create a custom query for my scenario. Here’s the DEMO I created. Suppose I have 2 or more parent tables and this table will be consume by a child table. tblParent1 tblParent2 tblParent3 Then there’s a child table where it consumes these 3 parent tables. tblChild And …