If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > LIKE Join query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-04, 23:33
pcmansf pcmansf is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
Cool LIKE Join query

Hi,
Thank you for looking into this.

I'm trying to have a query of this form:
SELECT * FROM table1, table2 WHERE table2.ids LIKE '%table1.id%' AND table2.status = 'something'

basically, I need to insert table1.id value into LIKE query. table1.id have one numeric value and table2.ids have varchar value like '1, 3, 344, 222'.

Thanks again,
Eugene
Reply With Quote
  #2 (permalink)  
Old 11-11-04, 06:15
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
the easiest thing would be to redesign the table so that you do not have a series of ids in a single column

do a search for first normal form
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On