Skip to content
Advertisement

Tag: sql

List of values as table

I’m looking for a smarter way to have a list of values as a table in Oracle. What I do nowadays is select ‘value1’ as val from dual union select ‘value2’ from dual What I’m hoping for is some …

Find missing rows between three related tables

I have three tables: Person Dates Absence I need to find all of the person_id’s in the Person table and the date’s from the Dates table who have not booked any absence matching the following criteria: Dates.date_type = ‘PUBLIC_HOLIDAY’ Absence.absence_type = ‘HOLIDAY’ Basically, I need to find the people and the dates which are public holidays they have not booked

how to comparison LAG function in mysql

I got complicated problem in mysql. I have some table on mydatabase. sample docs(this is only simple sample, actual data are so many table that I have to join) table “merchant” table “transaction” I want to know the information of merchants transaction daily “before” and “after” to comparison like this below I tried with this query but that query didn’t

Using BOTH scalar values and JSON objects as JSON values

I have a local table variable that I’m trying to populate with JSON key-value pairs. Sometimes the values are themselves JSON strings An example of what this ends up looking like: After populating it, I attempt to build it all up into a single JSON string, like so: The problem with this is that it turns the JSON values into

UPDATE command in a JSON

I’m trying to update a column in my table, but that column stores a JSON Object, but for that I need to do a where with a JSON as well. This is how the data is stored in my RG column: { “Id”:”…

Advertisement