Skip to content
Advertisement

SQL Query text formation logic after where condition

i need to generate a SQL Query using logic implemented in java, After WHERE conditions there can be multiple comparitions using AND OR NOT, eg:

This can be re-write as

tell me the logic how to group them properly to form a query.

Thanks Prasanth

Advertisement

Answer

You should wrap your condition by () to make each condition is properly.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement