# Is this sql correct?

**URL:** <https://forum.kirupa.com/t/is-this-sql-correct/240341>\
**Category:** programming\
**Created:** [October 2, 2007, 6:50am UTC](https://forum.kirupa.com/t/is-this-sql-correct/240341 "2007-10-02T06:50:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [October 2, 2007, 6:50am UTC](https://forum.kirupa.com/t/is-this-sql-correct/240341/1 "2007-10-02T06:50:02Z")

</div>

Hey Guys,

Is this sql correct?

select \* from top\_categories where action != ‘sub\_menu’ and action !=‘play\_audio’ and action = ‘text’ and path like ‘001,%’ or path = ‘023’ and top\_categories.purge = ‘false’ and text like ‘%search%’ or name like ‘%search%’

In english it should read:

“Select everything from top\_categories where the action does not equal sub\_menu or play\_audio but does equal text and the path starts with 001 or is equal to 023 and purge equals false and the text contains the word search or the page name contains the word search”

lol…and breath 😃

I’m pretty sure its returning some wrong results because o the wway I’ve balanced/structured my query …can anyone se anything glaringly obvious?

Zaid
