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 > Wildcards in LIKE comparison

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-31-04, 10:34
u_dmaclean u_dmaclean is offline
Registered User
 
Join Date: Dec 2004
Posts: 3
Wildcards in LIKE comparison

Is it possible to include wildcards in the column name of a WHERE clause?
i.e. -

SELECT
*
FROM
table_name
WHERE
column_name% LIKE '<string>';

Is there anything in MySQL that will allow me to accomplish this or something of this nature?

Thanks,

Dan
Reply With Quote
  #2 (permalink)  
Old 12-31-04, 12:07
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
So what you want to do is specify some part of a column name, then search a table for any column that matches that specification, then search those columns for values that match the LIKE pattern, right? That sounds like a job for dynamic SQL to me, maybe getting some help from a full text search index.

Depending on what tool(s) you are using, MySQL may be able to do what you are describing, but I don't know of anything built into MySQL that will do it for you.

-PatP
Reply With Quote
  #3 (permalink)  
Old 01-05-05, 15:58
u_dmaclean u_dmaclean is offline
Registered User
 
Join Date: Dec 2004
Posts: 3
It seems like it is not possible to construct LIKE comparisons in the way that I have been wondering. Just letting anyone know who may have been wondering as well.

-Dan
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