SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'Distinct' SQL problem

    This works in Access2000..

    SELECT DISTINCT News.NewsId, Upload.NewsID
    FROM News INNER JOIN Upload ON News.NewsId=Upload.NewsID


    But this doesn't work...

    SELECT DISTINCT News.NewsId, Upload.NewsID, News.Section1
    FROM News INNER JOIN Upload ON News.NewsId=Upload.NewsID


    error message: News.Section1 is a memo field and Distinct cannot be used with this method.

    Does anyone know of any work arounds? Need to get unique rows.


    thanks
    Mike

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, the text is very, very long. You know you cannot do WHERE text = 'ADAD', you have to use 'like', remember? You cannot do DISTINCT textcol since it is too hard for a RDBMS to compare text columns.

    Sorry, no can do. You could perhaps select the text column and ID into a temp table, then outer join to the main table where maintable.text LIKE 'othercol'

    But that may not work. You'll probably have to do it in your application.


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
  •