开发者

MYSQL PHP help with return a dataset

Hey guys...I am trying to get some data based on a condition which开发者_运维技巧 I don't know how to write the code for.

My table looks like this:

id | meta_id | key      | value  
--   -------   ---        -----

1  | 1       | image    | 0

2  | 1       | path     | 1

3  | 1       | location | parent

4  | 2       | image    | 1

5  | 2       | path     | 2

6  | 2       | location | self

From this how can i return the meta_id that has key = image and value = 1 and value = 2..so you see i have value 2 times...can this be done?


I hope I've understood

select * from table where key = 'image' and value in (1,2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜