simonradev

CTE

Oct 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. WITH cte (CustomerId)
  2. AS
  3. (
  4.     SELECT DISTINCT CustomerId
  5.     FROM Feedbacks
  6. )
  7.  
  8. SELECT CONCAT(c.FirstName, ' ', c.LastName) AS [CustomerName],
  9.        c.PhoneNumber,
  10.        c.Gender
  11. FROM Customers AS c
  12. WHERE c.Id NOT IN (SELECT CustomerId FROM cte)
  13. ORDER BY c.Id ASC
Add Comment
Please, Sign In to add comment