Thursday, 12 September 2013

How to query multi 'or' and a and in SQL?

How to query multi 'or' and a and in SQL?

a table like this
table
|primary_key| project | tag |
| 1 | 2 | 3 |
| 2 | 2 | 0 |
| 3 | 2 | 4 |
| 4 | 2 | 5 |
| 5 | 3 | 0 |
| 6 | 2 | 0 |
I want to query project with tag '(3|0) and 4' , In this example, the
output should be project 2? how could I write this in a SQL? I tried using
phpmyadmin to generate several result, but not work as I expect.

No comments:

Post a Comment