>From: Martijn Tonies [mailto:m.tonies@stripped]
>Sent: Wednesday, November 19, 2008 3:33 AM
>Subject: Re: Finding not quite duplicates
>> [JS] If there were one row that had prod_discont = 1, and another that
>> prod_discont = 0, and they both had the same prod_pub_prod_id,
>> 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
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.