Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    3

    Unanswered: 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

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    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

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •