MySQL question

Out of context: Reply #11

  • Started
  • Last post
  • 15 Responses
  • flavorful0

    SELECT
    blog_post.*,
    article.*
    FROM
    blog_post WITH(NOLOCK)
    INNER JOIN article WITH(NOLOCK)
    ON blog_post.tags = articles.tags
    WHERE
    blog_post.id = 8
    AND
    MATCH(blog_post.tags, article.tags) AGAINST ('work')

    ---
    Is tags a Unique ID, because if there really isn't any correlation to these tables in conjunction with that field you will have to run two seperate queries I imagine using a UNION and/or find a way to match them up.

    • Der, my tabs didn't show up, haha.flavorful
    • FAIL!
      #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WITH ( NOLOCK ) INNER JOIN article WITH ( NOLOCK ) ON blog_post.tags = article' at line 1
      cosmoo
    • Well it's not my fail, I explained why it won't work if there is no link field present in both tables.flavorful
    • hehe...i know.cosmoo

View thread