My current query is SELECT COUNT (DISTINCT(“json_extract_scalar”(“data”, ‘$.user_id’))) AS users, event, date(timestamp) FROM tableName WHERE category=’category’ GROUP BY event, date(timestamp) ORDER …
Select multiple values from a single underlying values as a table
I have a table from which I select multiple values based on two underlying values in the table select (1.2 + ca.MaxReturn), (1.0 + ca.MaxReturn), (1.0 + ca.MaxReturn * 0.50), (1….
I want to fetch 2 records with same id
This is my user table and i want to fetch 2 rows in descending using user_id. I want output like. Thanks in advance Answer I think you strictly need an ANCIer approach. You should try below co-related sub query – Fiddle.
MySQL get the matching rows for the min and max columns as in a single row
Hellow experts ! I have a timesheets table as below timesheets table +——————————————-+ |employee_no |time |device_id| +————————————-…
Not able to arrange data in descending order using sql
I have created the above table on SQL workbench and trying to run a very basic query of giving the data in desc order according to salary (code shown below along with output) however I am not getting …
How can i Set decimal value in SQL (something like 10.12345678)
Can’t store decimal value in SQL. Want to store like decimal(2,8) Like 32.12345678 [Column(TypeName = “decimal(2,8)”)] [Display(Name = “Latitude”)] public decimal Latitude { get; set;…
SQL decode column value to another column
I am using PL/SQL 12. I want to decode a column value to match another column value. I take the highest value of the the columns SP_RANK and MOODY_RANK and call it RANK. I want this column to instead …
Create database user with DDL in DB2
I am trying to create a user using DDL in DB2. I tried this: CREATE USER ‘test_user’ IDENTIFIED BY ‘password’; and I got this error message: An unexpected token “‘test_user’ IDENTIFIED BY ‘…
How to generate the dynamic where condition in pl/sql cursor
Generate the dynamic where condition in pl/sql cursor based on input values For Example : Input Values : a b c values Query Format : CREATE OR REPLACE Procedure abcprocedure ( a IN Number,b …
Is there a way to calculate total breaks time in between first_check_in and last_check_out?
MySQL version is 8.0.16 I want to obtain the total break time for a given date the table is as follows: id | employee_id | check_in | check_out ——————————-…