我有 2 个相关的表:
messages
--------
mid subject
--- -----------------
1 Hello world
2 Bye world
3 The third message
4 Last one
properties
----------
pid mid name value
--- --- ---------------- -----------
1 1 read false
2 1 importance high
3 2 read false
4 2 importance low
5 3 read true
6 3 importance low
7 4 read false
8 4 importance high
我需要从messages
使用properties
表上的标准中获得。例如:如果我有一个像return unread (read=false) high prio (importance=high) messages
它应该返回的标准
mid subject
--- -----------------
1 Hello world
4 Last one
我怎么能用 SELECT 子句(MySQL 方言)得到这个?