I am trying to compare the set of two JSON values for every transaction and extract specific values from the below.. I want to extract the following values cCode,dCode,hcps and mod..Can you please …
Tag: sql
mysql date conversion returns null converting certain months
I have this query (take a look on between dates): The select is between dates: startDate: (STR_TO_DATE(’11/24/2020′,’%m/%d/%y’)) finishDate: (STR_TO_DATE(’12/26/2021′,’%m/%d/%y’)) This query will return something because there are records on year 2020 the proble…
how to cast input in “SELECT * FROM PRODUCT LIMIT CAST(select CAST(‘1’ AS UNSIGNED)), 5”?
this will give error for syntax also tried create view to replace the (select CAST(‘1’ AS UNSIGNED)), which still doesnt work I am using mysql. Answer LIMIT clause cannot take expressions or variables. Therefore if you absolutely need such functionality, you must do a huge workaround – you h…
SQL Server: log database changes through generic trigger
Starting from this article, which is creating a trigger to log insert-, update- and delete-statements within the database, I’d like to create a similar trigger which doesn’t require to define the table and its columns. This would us to reduce human errors when dropping or adding columns. I’v…
Is it possible to create a SELECT for this?
I have (2) tables. match has (4) player IDs (pid1,pid2,pid3,pid4) and points for each player. (primary key match_id). player table has pid and the full name. I want to create a SQL select to full names and points for a given match. Create another SQL to select to full names and points for a given player id. C…
django: group by extracting month and year from a date
im trying to get a list of invoicepositions where there hasn’t been payed an payout to a person. Looking in the internet i came to this “Solution” but the query, that comes out is: so he added “created_at” and the id from the invoiceposition model although i don’t want that…
Redshift regex for before and after certain char
Data :- 1,2,3=20,4,5 select regexp_substr(data,’,3=[^,]*’) output = ,3=20 Desired output = 20 How do I get rid of,3=? I can add split_part(regexp_substr(Data,’,713=[^,]*’),’=’,2) but using the same expression would make sense. Thanks Answer You can extract a pattern using a…
Order by with formatted dates, doing it right?
I wanted a mere sanity check because I have a slight feeling I am doing it all wrong. I stripped down the use case to a very simple sample. When formatting a date I need to cast the data in the order …
SQL – Find Record count for multiple tables at a time in snowflake
I want to see counts have Tables at 1 time, instead of Running each. For EX: select COUNT(*) from “Fact_MASTER “; select COUNT(*) from “Dim_MASTER “; select COUNT(*) from “…
PostgreSQL – How to find the row with a record that matches it with a value higher than given value?
Let’s say I have two tables with a 1-to-many relation. Table A (user): id INT, name TEXT Table B (skill): id INT, user_id INT, skill_name TEXT, skill_level INT Each user may have multiple skills. And …