Re: Return or Select Partial String value
From: scmiles (anonymous_at_discussions.microsoft.com)
Date: 05/13/04
- Next message: Tomas: "DB name changes daily"
- Previous message: Rohtash Kapoor: "Re: Return or Select Partial String value"
- In reply to: Rohtash Kapoor: "Re: Return or Select Partial String value"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 09:42:42 -0700
Thank you, this works just fine.
>-----Original Message-----
>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
>
>
>.
>
- Next message: Tomas: "DB name changes daily"
- Previous message: Rohtash Kapoor: "Re: Return or Select Partial String value"
- In reply to: Rohtash Kapoor: "Re: Return or Select Partial String value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|