我有PostgreSQL的10.5表订阅:
id user_id starts_at ends_at
--------------------------------
1 233 02/04/19 03/03/19
2 233 03/04/19 04/03/19
3 296 02/09/19 03/08/19
4 126 02/01/19 02/28/19
5 126 03/01/19 03/31/19
6 922 02/22/19 03/22/19
7 111 01/22/19 02/21/19
8 111 02/22/19 03/21/19
我想看看没有内时,他们的月订阅结束2天开始,一个订阅谁user_ids。 对于在3月结束的订阅用户。
鉴于上面的表格,结果将是:
user_id
-------
296
126
922
111
我怎么会去把该查询一起三月?