Skip to content Skip to sidebar Skip to footer

Custom Select Query For Meta Table

I have a table structure as shown below I am running a query for search that searches for property id with provided meta_value against meta_name. I have used union, self join, un

Solution 1:

to get all that have meta_nameprice and propertyvalue and meta_value1000 and 10000 respectively, you need to do this.

SELECT*FROM `table` WHERE (meta_name ='price'and meta_value ='1000') OR (meta_name ='propertyvalue'and meta_value ='10000')

this will select both from table where meta_name = 'price' and meta_value = '1000' and meta_name = 'propertyvalue' and meta_value = '10000'

Post a Comment for "Custom Select Query For Meta Table"