MySQL Query across multiple

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Hotschins

    #1

    MySQL Query across multiple

    I've joined several columns from several tables, and I would like to
    perform a relevance match against these multiple columns.

    It looks something like this:

    SELECT * FROM table1 LEFT JOIN column1 ON table2.column1 LEFT JOIN
    column 2 ON table3.column1 WHERE
    MATCH
    (
    table2.column1, table3.column1)
    AGAINST ('%test%')

    However, I am getting an error message stating #1210 - Wrong arguments
    to MATCH

    It works absolutely fine when i am working with one table, but isn't
    working with multiple tables like above. If you have any suggestions,
    please let me know.

    Thanks.

    Bob Hotschins
  • Barry

    #2
    Re: MySQL Query across multiple

    You need to specify the second table after the Left Join and then which
    columns in each table are to be linked, e.g.

    SELECT * FROM table1 LEFT JOIN table2 ON table1.column1 = table2.column1

    Bob Hotschins wrote:
    [color=blue]
    >I've joined several columns from several tables, and I would like to
    >perform a relevance match against these multiple columns.
    >
    >It looks something like this:
    >
    >SELECT * FROM table1 LEFT JOIN column1 ON table2.column1 LEFT JOIN
    >column 2 ON table3.column1 WHERE
    >MATCH
    >(
    >table2.column1 , table3.column1)
    >AGAINST ('%test%')
    >
    >However, I am getting an error message stating #1210 - Wrong arguments
    >to MATCH
    >
    >It works absolutely fine when i am working with one table, but isn't
    >working with multiple tables like above. If you have any suggestions,
    >please let me know.
    >
    >Thanks.
    >
    >Bob Hotschins
    >
    >[/color]

    Comment

    • Barry

      #3
      Re: MySQL Query across multiple

      You need to specify the second table after the Left Join and then which
      columns in each table are to be linked, e.g.

      SELECT * FROM table1 LEFT JOIN table2 ON table1.column1 = table2.column1

      Bob Hotschins wrote:
      [color=blue]
      >I've joined several columns from several tables, and I would like to
      >perform a relevance match against these multiple columns.
      >
      >It looks something like this:
      >
      >SELECT * FROM table1 LEFT JOIN column1 ON table2.column1 LEFT JOIN
      >column 2 ON table3.column1 WHERE
      >MATCH
      >(
      >table2.column1 , table3.column1)
      >AGAINST ('%test%')
      >
      >However, I am getting an error message stating #1210 - Wrong arguments
      >to MATCH
      >
      >It works absolutely fine when i am working with one table, but isn't
      >working with multiple tables like above. If you have any suggestions,
      >please let me know.
      >
      >Thanks.
      >
      >Bob Hotschins
      >
      >[/color]

      Comment

      • Bob Hotschins

        #4
        Re: MySQL Query across multiple

        Actually that's I meant to say (I made a mistake when I wrote my
        example below).

        Of course, unfortunately it still doesn't work (I'm not able to query
        multiple columns using MATCH, but it *does* work using LIKE). I don't
        seem to get it.

        Bob Hotschins

        Barry <barry@nospampp solutions.co.uk > wrote in message news:<3F661246. 2050106@nospamp psolutions.co.u k>...[color=blue]
        > You need to specify the second table after the Left Join and then which
        > columns in each table are to be linked, e.g.
        >
        > SELECT * FROM table1 LEFT JOIN table2 ON table1.column1 = table2.column1
        >
        > Bob Hotschins wrote:
        >[color=green]
        > >I've joined several columns from several tables, and I would like to
        > >perform a relevance match against these multiple columns.
        > >
        > >It looks something like this:
        > >
        > >SELECT * FROM table1 LEFT JOIN column1 ON table2.column1 LEFT JOIN
        > >column 2 ON table3.column1 WHERE
        > >MATCH
        > >(
        > >table2.column1 , table3.column1)
        > >AGAINST ('%test%')
        > >
        > >However, I am getting an error message stating #1210 - Wrong arguments
        > >to MATCH
        > >
        > >It works absolutely fine when i am working with one table, but isn't
        > >working with multiple tables like above. If you have any suggestions,
        > >please let me know.
        > >
        > >Thanks.
        > >
        > >Bob Hotschins
        > >
        > >[/color][/color]

        Comment

        • Bob Hotschins

          #5
          Re: MySQL Query across multiple

          Actually that's I meant to say (I made a mistake when I wrote my
          example below).

          Of course, unfortunately it still doesn't work (I'm not able to query
          multiple columns using MATCH, but it *does* work using LIKE). I don't
          seem to get it.

          Bob Hotschins

          Barry <barry@nospampp solutions.co.uk > wrote in message news:<3F661246. 2050106@nospamp psolutions.co.u k>...[color=blue]
          > You need to specify the second table after the Left Join and then which
          > columns in each table are to be linked, e.g.
          >
          > SELECT * FROM table1 LEFT JOIN table2 ON table1.column1 = table2.column1
          >
          > Bob Hotschins wrote:
          >[color=green]
          > >I've joined several columns from several tables, and I would like to
          > >perform a relevance match against these multiple columns.
          > >
          > >It looks something like this:
          > >
          > >SELECT * FROM table1 LEFT JOIN column1 ON table2.column1 LEFT JOIN
          > >column 2 ON table3.column1 WHERE
          > >MATCH
          > >(
          > >table2.column1 , table3.column1)
          > >AGAINST ('%test%')
          > >
          > >However, I am getting an error message stating #1210 - Wrong arguments
          > >to MATCH
          > >
          > >It works absolutely fine when i am working with one table, but isn't
          > >working with multiple tables like above. If you have any suggestions,
          > >please let me know.
          > >
          > >Thanks.
          > >
          > >Bob Hotschins
          > >
          > >[/color][/color]

          Comment

          Working...