>-----Original Message----- >From: Martijn Tonies [mailto:[EMAIL PROTECTED] >Sent: Wednesday, November 19, 2008 3:33 AM >To: mysql@lists.mysql.com >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. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]