我有一张桌子
email::string
location::string
day_1::boolean
day_2::boolean
...
现在我需要每天email
OR
天获得。对于以下输入
user1@gmail.com | location1 | true | false
user1@gmail.com | location2 | false | true
我想要
user1@gmail.com | true | true
答案 0 :(得分:1)
SELECT email, bool_or(day_1) AS day_1, bool_or(day_2) AS day_2 FROM your_table GROUP BY email