hi
syntax of non matching rows in a query with where clause in sql with example
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 24, 2014, 5:54 AM
Maneesh A NPosted Sep 24, 2014, 4:51 AM
please make it correct?
create procedure prcexpincbalprint
error found
Msg 102, Level 15, State 1, Procedure prcexpincbalprint, Line 9
DRISHTYPosted Sep 24, 2014, 3:19 AM
CREATE TABLE TEMP1(ID BIGINT,Datevalue date)
CREATE TABLE TEMP2(ID BIGINT,Datevalue date)
INSERT INTO TEMP1
SELECT 1,'2014-09-03' UNION
SELECT 2,'2014-09-04' UNION
SELECT 3,NULL UNION
SELECT 4,NULL
INSERT INTO TEMP2
SELECT 1,'2014-09-03' UNION
SELECT 2,'2014-09-05' UNION
SELECT 4,NULL UNION
SELECT 5,NULL
SELECT * FROM TEMP1
SELECT * FROM TEMP2
SELECT *
FROM TEMP1
FULL OUTER JOIN TEMP2 ON TEMP1.Datevalue = TEMP2.Datevalue
WHERE TEMP1.Datevalue IS NULL
OR TEMP2.Datevalue IS NULL
DROP TABLE TEMP1
DROP TABLE TEMP2
END
Maneesh A NPosted Sep 24, 2014, 2:52 AM
DRISHTYPosted Sep 24, 2014, 2:15 AM
http://stackoverflow.com/questions/5840217/sql-query-help-to-get-non-matching-records-from-two-tables