hii friends i have a first temporary table in which some column
like : client id, client name, details
and another second table : city
in which have column clientid, city name,
and want select both table with inner join
first table it have 200 record and both tables some client id same
i want select those record from first table that client id it not have in second table
i want remaining client details which client id not common in second table


Manas MohapatraRank #182 · 13.2K reputationPosted Nov 26, 2016, 2:49 AM EST
SELECT * FROM table1
LEFT JOIN table2 ON table1.ClientID = table2.ClientID
WHERE table2.City IS NULL
Or you can use EXCEPT in SQLServer
SELECT ID, NAME, AMOUNT, DATE
FROM CUSTOMERS
LEFT JOIN ORDERS
FROM CUSTOMERS
RIGHT JOIN ORDERS
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Nov 27, 2016, 1:49 AM EST