Re: Return or Select Partial String value
From: Rohtash Kapoor (rohtash_nospam_at_sqlmantra.com)
Date: 05/13/04
- Previous message: scmiles: "Return or Select Partial String value"
- In reply to: scmiles: "Return or Select Partial String value"
- Next in thread: scmiles: "Re: Return or Select Partial String value"
- Reply: scmiles: "Re: Return or Select Partial String value"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 08:10:49 -0700
CREATE TABLE #Temp_First
(
Num VARCHAR(20)
)
CREATE TABLE #Temp_Second
(
Num VARCHAR(40),
Des VARCHAR(40)
)
INSERT INTO #Temp_First VALUES ('11111')
INSERT INTO #Temp_First VALUES ('44444')
INSERT INTO #Temp_First VALUES ('55555')
INSERT INTO #Temp_Second VALUES ('www.domain.com/11111','comment1')
INSERT INTO #Temp_Second VALUES ('www.domain.com/44444','comment2')
INSERT INTO #Temp_Second VALUES ('www.domain.com/55555','comment3')
SELECT * FROM
#Temp_First
JOIN #Temp_Second
ON #Temp_Second.num LIKE '%' + #Temp_First.num
--- Rohtash Kapoor http://www.sqlmantra.com "scmiles" <anonymous@discussions.microsoft.com> wrote in message news:cb3001c438f8$ca6ecb40$a301280a@phx.gbl... > I need a SELECT query that can compare/match a string > value, example, tableX.number = '12345' from tableX, to > tableY.URL = 'http://www.domain.com/folder/name-12345' > > so the WHERE clause can match the two by the full value > of tableX.number to the partial value at the end of > tableY.URL > > Any help appreciated > Thanks
- Previous message: scmiles: "Return or Select Partial String value"
- In reply to: scmiles: "Return or Select Partial String value"
- Next in thread: scmiles: "Re: Return or Select Partial String value"
- Reply: scmiles: "Re: Return or Select Partial String value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|