I have a table called locations that has these rows: id uuid NOT NULL, “deviceId” text COLLATE pg_catalog.”default”, “userId” uuid, “userName” text COLLATE pg_catalog.”default”, “creationDateTime” …
Tag: sql
SQL SUM on multiple INNER JOIN
I am trying to get the sum of particular fields through multiple table using joins. I am getting the SUM wrong when I I try to get the values together. I have table State as I have another table Balance as I have one more table Loan as What I want as a result from my query is, When I
How to search if a row is a substring of another row of the same column in Oracle
I have a table that contains millions of rows for names of customers as a column. I want to find if a part of a name exists within another row in the same column. E.g. If a row has value ‘Roger …
Oracle PL/SQL: how to execute a procedure with a varray as out parameter?
I’m writing a stored procedure that will receive a code and return one or more VARCHAR2 values. The number of values will vary according to the code the procedure receives. I don’t know if this is …
Grouping certain rows into one row in sqlite
This is the query that got me this result. SELECT country, COUNT(DISTINCT(customer_id)) total_customers FROM customer c GROUP BY 1 ORDER BY 2 DESC country total_customers 1 India …
oracle get all matched occurrences from a column
I have a table, which has 2 columns: ID & JOB_Description(Text). I would like to write an oracle SQL to extract all substrings in the Description column which match a regular pattern. However, I have learnt how to extract matched substrings from a string with below SQL, but I have no idea to apply below SQL on all data in
Query working in mySql and not working in Oracle
Below is the query which is working in MySQL and not working in Oracle. Here I need to get the latest Date and corresponding event from table r for every ID in Table a . ID is unique. SELECT a….
Join multiple tables and single output using Entity Framework mvc5
I am very new to linq query so I need to join multiple tables and single output using Entity Framework mvc5 Below is my 3 table structures and Table_Application is a main table 1) Table_Application …
Get list of SQL server databases which files have been deleted
My goal is getting list of SQL server databases which files have been deleted. In other words. I attach a db from mount, then close the mount so actually I have the attached db without files. At …
Which one is quicker/optimized – Inner Join or Partition By – to obtain Aggregated data?
In my data ‘table1’, there are multiple records for each app_id. I’m trying to get a latest app_id entry. Which one of the below queries would be quick or better to consider in terms of performance …