开发者

MYSQL PHP help with return a dataset

开发者 https://www.devze.com 2023-02-17 14:57 出处:网络
Hey guys...I am trying to get some data based on a condition which开发者_运维技巧 I don\'t know how to write the code for.

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

精彩评论

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