Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with a SQL

Status
Not open for further replies.

cwal

Programmer
Jun 12, 2002
4
BR
It is wrong, since it always returns nothing.

INSERT INTO dbo.TBCONTABIL2002
(DATA, URL)
SELECT '260402' , A.URL
FROM tempTotalUrl A , TBCONTABIL2002 B
WHERE ('260402' <> B.DATA) AND (A.URL <> B.URL )
 
Try this.

INSERT INTO dbo.TBCONTABIL2002 (DATA, URL)
SELECT '260402' , A.URL
FROM tempTotalUrl A
WHERE NOT EXISTS
(SELECT * FROM TBCONTABIL2002
WHERE URL=A.URL AND DATA='260402') Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains &quot;Suggestions for Getting Quick and Appropriate Answers&quot; to your questions.
 
Thank you tbroadbent. Your suggestion works perfectly, you help me a lot.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top