Re: Nasty Test string SELECT Statement
From: David Hills (dhills_at_pcfe.ac.uk)
Date: 04/30/04
- Next message: Jeff Duncan: "Re: Register a named instance of SQL Server in EM"
- Previous message: Jeff Smyrski: "Creating a Knowledge Base"
- In reply to: Tim Bird: "Re: Nasty Test string SELECT Statement"
- Next in thread: Robert Carnegie: "Re: Nasty Test string SELECT Statement"
- Reply: Robert Carnegie: "Re: Nasty Test string SELECT Statement"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Apr 2004 07:53:26 -0700
Thanks for your replys
this code below works, but I also need to return in the query the first
number from the number table that exists
nn.number nasty_string
11002 "#(9322 9742 10582 11002 11422 )"
Sorry thats not explained clearly!!
What I need is to return the nn.number that gives the first postive
EXISTS result in the WHERE CLAUSE
create TABLE #numbers
(number INTEGER)
delete #numbers
declare @mycount as integer
set @mycount=14280
WHILE @mycount < 14339
BEGIN
insert into #numbers
values (@mycount)
set @mycount=@mycount+1
END
--select * from #Numbers
SELECT nasty_string
FROM sdvp_activ_schedul
WHERE EXISTS(
select * from #numbers nn
where number between 14280 and 14339
AND CHARINDEX(' '+CAST(nn.number as varchar)+' ',nasty_string)>0
)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Jeff Duncan: "Re: Register a named instance of SQL Server in EM"
- Previous message: Jeff Smyrski: "Creating a Knowledge Base"
- In reply to: Tim Bird: "Re: Nasty Test string SELECT Statement"
- Next in thread: Robert Carnegie: "Re: Nasty Test string SELECT Statement"
- Reply: Robert Carnegie: "Re: Nasty Test string SELECT Statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|