Meta_Keys

Hi There,
I'm trying to query a Wordpress database and it's meta_keys
My Code is:
SELECT order_id
FROM pxyv_wc_orders_meta
WHERE (meta_key, meta_value) = ("_billing_collection_date","08/04/2024")
AND EXISTS (SELECT 1
FROM pxyv_wc_orders_meta
WHERE (meta_key, meta_value) = ("_billing_collection_time","Afternoon 13:00 - 17:00")
)

But the "AND Exists" part does not work.
I'm trying to reference 2 Meta_Values on the same row.

Can anyone help.

Thanks.

Best Regards,
Steve.

SQLTeam.com is a Microsoft SQL Server site, WordPress is hosted on MySQL. We're not experts in MySQL, and the syntax you've posted isn't compatible with SQL Server.

Not sure if these links will help, but it's all I can think of:

https://dev.mysql.com/doc/refman/8.0/en/row-subqueries.html
https://dev.mysql.com/doc/refman/8.0/en/exists-and-not-exists-subqueries.html