SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kabon
Starting Member

Indonesia
48 Posts

Posted - 03/27/2013 :  03:06:50  Show Profile  Reply with Quote
can i use script select where in and not in together?
for example :

SELECT REPLACE(B.[Column 0] COLLATE Latin1_General_100_BIN2 ,LEFT(B.[Column 0],CHARINDEX('.',B.[Column 0])-1),isnull(C.T24_ID,LEFT(B.[Column 0],CHARINDEX('.',B.[Column 0])-1)))
from LDTLTXT_20130314 as B
LEFT JOIN F_CUSTOMER_ALT_CUST_ID C ON LEFT(B.[Column 0],CHARINDEX('.',B.[Column 0])-1) COLLATE Latin1_General_100_BIN2 =C.LEGACY_ID
WHERE REPLACE(B.[Column 0] COLLATE Latin1_General_100_BIN2 ,LEFT(B.[Column 0],CHARINDEX('.',B.[Column 0])-1),isnull(C.T24_ID,LEFT(B.[Column 0],CHARINDEX('.',B.[Column 0])-1))) COLLATE Latin1_General_100_BIN2 in
(SELECT LEFT(REPLACE(HIST.RECID,LEFT(HIST.RECID,CHARINDEX('.',HIST.RECID)-1),isnull(D.T24_ID,LEFT(HIST.RECID,CHARINDEX('.',HIST.RECID)-1))),19)
FROM t24testsby.dbo.FBNK_LIMIT#HIS AS HIST WITH(NOLOCK)
LEFT JOIN F_CUSTOMER_ALT_CUST_ID D ON LEFT(HIST.RECID,CHARINDEX('.',HIST.RECID)-1)=D.LEGACY_ID
WHERE LEFT(REPLACE(HIST.RECID,LEFT(HIST.RECID,CHARINDEX('.',HIST.RECID)-1),isnull(D.T24_ID,LEFT(HIST.RECID,CHARINDEX('.',HIST.RECID)-1))),19) NOT IN
(SELECT RECID FROM t24testsby.dbo.FBNK_LIMIT WITH (NOLOCK))
)

I've tried but i don't know why doesn't finish

bandi
Flowing Fount of Yak Knowledge

India
2210 Posts

Posted - 03/27/2013 :  04:52:59  Show Profile  Reply with Quote
what is the problem with above query?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000