Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 JOIN CONDIATIN LOGIC(SSMS 2008)

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-01-24 : 08:32:17

Hi,

i have 2 tables

i need to join table1 id to table 2 substring in SSMS

EXAMPLE

TABLE 1

NO NAME ID
1 DSFD 0958/0958cbd11000900/01
2 FGDS 0926/0926abc11000989/01
3 FGDSsdf 0958/0926abc11000522/01


table 2

loc sal no
sdfd 2000 0958cbd11000900
sdfd 2000 0926cbd11000989
sdfd 2000 0958cbd11000522


here i had join substring(table1.id ,5,15)=table2.no

the above join is correct or not

i did not get the data

can anybody know the pls logic tell me

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-24 : 08:41:08
select substring('0958/0958cbd11000900/01',5,15) = /0958cbd1100090
select substring('0958/0958cbd11000900/01',6,15) = 0958cbd11000900



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -