Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
I want to query data with string like 'abba'
Old 07-29-2008, 12:09 AM I want to query data with string like 'abba'
Junior Talker

Posts: 1
Trades: 0
Hi,

I want to query data with string in a pattern like 'aba', 'abba'...
E.g: '121', '1221', ...

How could I do that? I'm using MS Access 2003 and SQL Server 2000

Plz help me!

Thanks in advance!
manyud351 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-29-2008, 01:27 PM Re: I want to query data with string like 'abba'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
where field LIKE pattern

http://www.w3schools.com/sql/sql_where.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-30-2008, 07:01 PM Re: I want to query data with string like 'abba'
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
It sounds to me like maybe you are saying you want to match more than one pattern in the data, where the common factor is that it's palindromic?

I have done very little pattern matching with sql and stay away from ms access, but maybe this is the direction to look in...

Quote:
Reverse a String

Access: SELECT STRREVERSE(StringVal)
T-SQL: SELECT REVERSE(StringVal)
I mean... if it's palindromes you want to match, then you could be a clever lad and test to see if the reversed string is the same as the original string... however, maybe you'll have to go through all the data and check for the match, rather than just 'selecting' matching data - I dunno much about it, but the reverse-a-string concept would blatantly be a show-off way to get it done, assuming I understood what you were asking.


IF i had to do it, I'd be using perl, and i dunno if there's any string-reverse functions in perl (although i'll probably check it out one day)

so i'd actually go through each item, break it up into characters, and perform a multitude of tests - almost as complicated as trying to write it in C - but i expect there's a reverse-string option in c too!
witnesstheday is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I want to query data with string like 'abba'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21190 seconds with 12 queries