SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    844
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Need some help with using DISTINCT

    Here is my query:

    SELECT distinct user, keyword FROM searches WHERE MATCH (keyword) AGAINST ('Lavender helped my sore jaw') order by user

    This produces a listing of searches conducted by my website users, including many duplicates. For example, user # 110 may have conducted three searches that each meet the criteria of my query:

    110 - lavender uses
    110 - sore legs
    110 - jaw surgery

    How come distinct is not working in this particular case? I want to send out one email notification to user # 110, not three emails.
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,016
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    remove keyword from the SELECT clause
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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