Search
 
SCRIPT & CODE EXAMPLE
 

SQL

inner join distinct

SELECT valueC
FROM C
INNER JOIN
(
    SELECT DISTINCT lookupC
    FROM B INNER JOIN
    (
        SELECT DISTINCT lookupB
        FROM A
    ) 
    A2 ON B.id = A2.lookupB
) 
B2 ON C.id = B2.lookupC
Comment

PREVIOUS NEXT
Code Example
Sql :: truncate all tables 
Sql :: query to count the number of rows in a table in sqlalchemy 
Sql :: where with multiple conditions in mongodb 
Sql :: psql execute sql file 
Sql :: raiserror nowait sql server 
Sql :: postgres how to index a column 
Sql :: sql select rows with different values in one column 
Sql :: Write an SQL query to print details of the Workers who have joined in Feb’2014 
Sql :: division by zero postgres 
Sql :: convert polygon to text in mysql 
Sql :: query by column for substring sql 
Sql :: increment integer in table sql 
Sql :: get max salary from each department sql 
Sql :: sql period overlap 
Sql :: Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’. 
Sql :: mysql create table from select statement 
Sql :: mysql url data type 
Sql :: Add image in MySQL database 
Sql :: sql joins 
Sql :: alter or change postgresql sequence counter 
Sql :: sql server current time without date 
Sql :: mysql random 
Sql :: psql no such file or directory 
Sql :: create table mysql integer NOT null 
Sql :: sql alchemy or 
Sql :: postgresql change user role grant 
Sql :: timestamp difference sql 
Sql :: pl sql case 
Sql :: create function postgresql 
Sql :: postgresql newline character 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =