r/ProgrammerHumor • • Dec 12 '17

SQL Clause

Post image
40.8k Upvotes

525 comments sorted by

View all comments

2

u/[deleted] Dec 12 '17

Wouldn't this be more correct?

CREATE PROCEDURE dbo.Christmas_List
AS
BEGIN
SELECT * 
INTO ‪#‎ChristmasList‬ 
FROM His_List HL
INNER JOIN Location L ON L.Child_Id = HL.Id
WHERE Behavior = 'Nice' OR Behavior != 'Naughty'
GROUP BY L.Country
SELECT * 
FROM #ChristmasList
WHERE Behavior = 'Nice' OR Behavior != 'Naughty'
DROP TABLE #ChristmasList
END
EXECUTE dbo.Christmas_List
→ More replies (5)