List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:November 19 2008 9:39pm
Subject:RE: Finding not quite duplicates
View as plain text  

>-----Original Message-----
>From: Martijn Tonies [mailto:m.tonies@stripped]
>Sent: Wednesday, November 19, 2008 3:33 AM
>To: mysql@stripped
>Subject: Re: Finding not quite duplicates
>


>> [JS] If there were one row that had prod_discont = 1, and another that
>had
>> prod_discont = 0, and they both had the same prod_pub_prod_id,
>wouldn't
>both
>> rows be returned? That's not what I need.
>

>Given that "prod_discont" is an integer, can you use MAX/MIN to see if
>there's one? If there's none (in the JOIN), it will return NULL, right?
>
[JS] I hadn't thought of that! I'll give it a hard look.

>As a sidenote, your strings should be enclosed by single quotes, as per
>SQL standard, not double quotes, those are reserved for delimited
>identifiers.
>
Hmmm. I've sort-of carried that over from the way I do PHP. I tend to use
single quotes for strings that have no variables in them, so I use
double-quotes around strings within the strings:

$query = 'UPDATE foo SET field = "always"'

That way I don't have to escape things, which I think makes them harder to
read. I'll take your comment under advisement.




Thread
Finding not quite duplicatesJerry Schwartz18 Nov
  • Re: Finding not quite duplicatesBill newton19 Nov
    • RE: Finding not quite duplicatesUS Data Export19 Nov
      • Re: Finding not quite duplicatesBill newton19 Nov
  • Re: Finding not quite duplicatesMartijn Tonies19 Nov
    • RE: Finding not quite duplicatesJerry Schwartz19 Nov
  • Re: Finding not quite duplicatesMartijn Tonies20 Nov