Strange problem with "select distinct"...

Results 1 to 2 of 2

Thread: Strange problem with "select distinct"...

  1. #1
    Join Date
    Dec 1969

    Default Strange problem with "select distinct"...

    Hi,<BR><BR>Ashort time ago Bill told me (as response to one of my question) that I should use Select Distinct to display only one record (from several identical records).<BR><BR>Now I see a strange behaviour of this Distinct (well, maybe strange for me because I don&#039;t know what is the cause).<BR><BR>When I&#039;m using it offline it works OK.<BR>When I put that script online it doesn&#039;t work!<BR><BR>It&#039;s a search script (offline founds what it needs to find but online always return me No records found).<BR><BR>On the local computer I&#039;m using PWS 4.0 on Win98 (database is Access 2000)<BR>On the online server I&#039;m using IIS 5.0 on Win 2000 Server(database is the same Access 2000).<BR><BR>This is my SQL statement with Distinct:<BR>---------<BR><BR>sqlq = "select distinct products.productid, products.Nr, products.Author, products.Title, products.Subtitle, products.Sonder, products.Price, products.Old_price,products.FilePath,products.not_ shown FROM products INNER JOIN links ON products.productid = links.product_id where not_shown=0 and (Nr like &#039;%" & search & "%&#039; or Author like &#039;%" & search & "%&#039; or Title like &#039;%" & search & "%&#039; or Subtitle like &#039;%" & search & "%&#039;) order by Nr asc"<BR>------------<BR><BR>What could be the problem?<BR><BR>Thanks,<BR>Mircea<BR>

  2. #2
    Join Date
    Dec 1969

    Default So take out the DISTINCT...

    ...and show us all the records you get from that. That is, just dump the data out. (You can use that DUMP code I put in the ASPFAQs, if you want.)<BR><BR>*THEN* let&#039;s see if we can figure out why DISTINCT is messing up.<BR><BR>

Posting Permissions

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