MySQL Forums
Forum List  »  Newbie

Re: Syntax Error
Posted by: Phillip Ward
Date: April 28, 2016 06:54AM

Quote

... and ((Software.`Name` = 'Malwarebytes Anti-Malware version 1.80.0.1010') AND (Software.`Name` = 'Livedrive'))

Look at that where clause again:

. . . 
and Software.Name = 'Malwarebytes Anti-Malware version 1.80.0.10' 
and Software.Name = 'Livedrive'

The Name field on any one record cannot hold two values at the same time, so the above will never find any results.

You need to check for one value or the other, but remember that 'and's and 'or's have different precedences (order of execution) so you need brackets to make the or operation more "important".

. . . 
and 
(  Software.`Name` = 'Malwarebytes Anti-Malware version 1.80.0.1010') 
OR Software.`Name` = 'Livedrive' 
)

Also, as Peter says, get into the habit of building your joins explicitly.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
April 27, 2016 10:55AM
April 27, 2016 12:18PM
April 28, 2016 07:14AM
Re: Syntax Error
April 28, 2016 06:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.