Mysql – Query outer join fixed values
I would like to query some IDs (fixed values) into a table, like a "outer join" with the mandatory fields should be the fixed values. I have to do the same for SQLServer and MySQL, but with one solution I…
I would like to query some IDs (fixed values) into a table, like a "outer join" with the mandatory fields should be the fixed values. I have to do the same for SQLServer and MySQL, but with one solution I…
I'm currently struggling to import my API-Response to my Oracle table. I'm using the JSON_TABLE() but this function is not working as expected. I have a JSON value like this: { "CAR-1": [ { "state": "waiting", "timestamp": 1720476000 } ],…
select * from bha b where b.bks similar to 'd{2}[A-Z](d{2})d\1'; The purpose is to regex but bks is in the form 12A56856 12A12812 12A898389 Although I already have this data in my database, the query is still not successful. I…
1/ I am using SQL on AWS and trying to detect quickly when a Json object has key-value in it. Anyone knows it? Thanks For example: A. {"context":{"abc":"123"} --> Yes B. {"context":{}} --> No Note that I don't know in…
Below is my query in laravel project.In this query purchase_return_products.purchase amount actually exists but this show error '[2024-07-14 16:28:02] local.ERROR: Errors: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'purchase_return_products.purchase_amount' in 'field list' (Connection: mysql, SQL: select count(*) as aggregate from…
I use infinite scroll at my site and I have to return two variables. The first one is data like 10 users. The second one is total. Total all users from my whole table. Now my query is this: const…
Trying to write a query to get the total number of sales per month. So I can currently write this query to return the month and year: SELECT DISTINCT(MONTHNAME(STR_TO_DATE(`date`, '%m/%d/%Y'))) AS 'Month' ,YEAR(STR_TO_DATE(`date`, '%m/%d/%Y')) AS 'Year' ,`total` FROM `supermarket_sales` And…
WHAT I HAVE CURRENTLY: I have a table with Customer_ID, Start_Date, Frequency, Day I have a second table with simply a list of dates throughout the year 2024 and day of the week, like the below... Date Day 01/01/2024 Monday…
I have a trade history table that looks like this: CREATE TABLE trade ( trade_id INT PRIMARY KEY, stock_id INT NOT NULL, date DATE NOT NULL, sell BOOLEAN NOT NULL, shares INT NOT NULL, usd_total DECIMAL(10, 2) NOT NULL );…
I have 2 queries which give count of cases based upon a condition Query 1: Select count(unique c.caseid) as New_cases from caseinfo c where (c.crtdate between TO_DATE('2024/07/08') AND TO_DATE('2024/07/11')) and c.channel is not null; Query 2: Select count(unique c.caseid) as…