mysql - SQL not returning expected rows -


my sql select statement not returning correct rows. have table named activities , statement should output rows column 'approved' = yes , of cells have text 'test'. statement still outputting of rows approved = no, not of them.

this sql statement:

select * activities approved = 'yes' , title '%test%' or subject '%test%' or industry '%test%' or description '%test%' order date_added desc 

move or conditions within () as

select * activities  approved = 'yes'  , (  title '%test%'  or subject '%test%' or industry '%test%'  or description '%test%'  ) order date_added desc 

so filter as

  • if approved = 'yes'
  • and title or subject ....

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -