Advertisement
szabozoltan69

query_fact

Sep 8th, 2021
1,877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT "deployments_deployedperson"."id", "deployments_deployedperson"."start_date", "deployments_deployedperson"."end_date", "deployments_deployedperson"."name", "deployments_deployedperson"."role", "deployments_deployedperson"."role_en", "deployments_deployedperson"."role_es", "deployments_deployedperson"."role_fr", "deployments_deployedperson"."role_ar", "deployments_personnel"."deployedperson_ptr_id", "deployments_personnel"."type", "deployments_personnel"."country_from_id", "deployments_personnel"."deployment_id", "deployments_personnel"."molnix_id", "deployments_personnel"."is_active"
  2. FROM "deployments_personnel" INNER JOIN
  3.      "deployments_deployedperson" ON ("deployments_personnel"."deployedperson_ptr_id" = "deployments_deployedperson"."id")
  4.      WHERE ("deployments_personnel"."is_active" = True
  5.        AND "deployments_deployedperson"."end_date" > now()
  6.        AND "deployments_deployedperson"."start_date" < now());
  7.  id  |       start_date       |        end_date        |           name            |                         role                         |                       role_en                        | role_es | role_fr | role_ar | deployedperson_ptr_id | type | country_from_id | deployment_id | molnix_id | is_active
  8. -----+------------------------+------------------------+---------------------------+------------------------------------------------------+------------------------------------------------------+---------+---------+---------+-----------------------+------+-----------------+---------------+-----------+-----------
  9.  131 | 2021-07-02 08:37:36+00 | 2021-09-10 08:37:37+00 | TEST3                     |                                                      |                                                      |         |         |         |                   131 | rr   |              16 |         23845 |           | t
  10.  132 | 2021-07-02 08:37:46+00 | 2021-09-16 08:37:47+00 | TEST4                     |                                                      |                                                      |         |         |         |                   132 | fact |              16 |         23845 |           | t
  11.  129 | 2021-07-02 08:16:56+00 | 2021-09-16 08:16:52+00 | TEST                      | TEST                                                 | TEST                                                 |         |         |         |                   129 | rr   |              14 |         23845 |           | t
  12.  130 | 2021-07-02 08:17:03+00 | 2021-09-17 08:17:02+00 | TEST2                     | TEST2                                                | TEST2                                                |         |         |         |                   130 | rr   |              14 |         23845 |           | t
  13.  123 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Mohamed, Mahmoud          | MHPSS Coordinator, Population Movement, Libya        | MHPSS Coordinator, Population Movement, Libya        |         |         |         |                   123 | rr   |             289 |         23847 |        66 | t
  14.  124 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Affolter, Yvonne Gabriela | Migration Coordinator, Population Movement, Libya    | Migration Coordinator, Population Movement, Libya    |         |         |         |                   124 | rr   |             165 |         23847 |        67 | t
  15.  121 | 2021-06-30 00:00:00+00 | 2021-10-14 00:00:00+00 | Holm Nielsen, Pablo       | CVA Coordinator, Population Movement, Libya          | CVA Coordinator, Population Movement, Libya          |         |         |         |                   121 | rr   |              56 |         23847 |        65 | t
  16.  127 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Lasso, Lucia              | HEOps, Population Movement, Libya                    | HEOps, Population Movement, Libya                    |         |         |         |                   127 | rr   |             289 |         23847 |        63 | t
  17.  128 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Fakoor, Mohamad           | Field Coordinator, Population Movement, Libya        | Field Coordinator, Population Movement, Libya        |         |         |         |                   128 | rr   |                 |         23847 |        62 | t
  18.  120 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Bulliard, Jean-Marc       | Supply Chain Coordinator, Population Movement, Libya | Supply Chain Coordinator, Population Movement, Libya |         |         |         |                   120 | rr   |             165 |         23847 |        61 | t
  19. (10 rows)
  20.  
  21. test=#
  22. test=# SELECT "deployments_deployedperson"."id", "deployments_deployedperson"."start_date", "deployments_deployedperson"."end_date", "deployments_deployedperson"."name", "deployments_deployedperson"."role", "deployments_deployedperson"."role_en", "deployments_deployedperson"."role_es", "deployments_deployedperson"."role_fr", "deployments_deployedperson"."role_ar", "deployments_personnel"."deployedperson_ptr_id", "deployments_personnel"."type", "deployments_personnel"."country_from_id", "deployments_personnel"."deployment_id", "deployments_personnel"."molnix_id", "deployments_personnel"."is_active"
  23. test-# FROM "deployments_personnel" INNER JOIN
  24. test-#      "deployments_deployedperson" ON ("deployments_personnel"."deployedperson_ptr_id" = "deployments_deployedperson"."id")
  25. test-#      WHERE ("deployments_personnel"."is_active" = True
  26. test(#        AND             "deployments_personnel"."type" = 'rr'
  27. test(#        AND "deployments_deployedperson"."end_date" > now()
  28. test(#        AND "deployments_deployedperson"."start_date" < now());
  29.  id  |       start_date       |        end_date        |           name            |                         role                         |                       role_en                        | role_es | role_fr | role_ar | deployedperson_ptr_id | type | country_from_id | deployment_id | molnix_id | is_active
  30. -----+------------------------+------------------------+---------------------------+------------------------------------------------------+------------------------------------------------------+---------+---------+---------+-----------------------+------+-----------------+---------------+-----------+-----------
  31.  131 | 2021-07-02 08:37:36+00 | 2021-09-10 08:37:37+00 | TEST3                     |                                                      |                                                      |         |         |         |                   131 | rr   |              16 |         23845 |           | t
  32.  129 | 2021-07-02 08:16:56+00 | 2021-09-16 08:16:52+00 | TEST                      | TEST                                                 | TEST                                                 |         |         |         |                   129 | rr   |              14 |         23845 |           | t
  33.  130 | 2021-07-02 08:17:03+00 | 2021-09-17 08:17:02+00 | TEST2                     | TEST2                                                | TEST2                                                |         |         |         |                   130 | rr   |              14 |         23845 |           | t
  34.  123 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Mohamed, Mahmoud          | MHPSS Coordinator, Population Movement, Libya        | MHPSS Coordinator, Population Movement, Libya        |         |         |         |                   123 | rr   |             289 |         23847 |        66 | t
  35.  124 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Affolter, Yvonne Gabriela | Migration Coordinator, Population Movement, Libya    | Migration Coordinator, Population Movement, Libya    |         |         |         |                   124 | rr   |             165 |         23847 |        67 | t
  36.  121 | 2021-06-30 00:00:00+00 | 2021-10-14 00:00:00+00 | Holm Nielsen, Pablo       | CVA Coordinator, Population Movement, Libya          | CVA Coordinator, Population Movement, Libya          |         |         |         |                   121 | rr   |              56 |         23847 |        65 | t
  37.  127 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Lasso, Lucia              | HEOps, Population Movement, Libya                    | HEOps, Population Movement, Libya                    |         |         |         |                   127 | rr   |             289 |         23847 |        63 | t
  38.  128 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Fakoor, Mohamad           | Field Coordinator, Population Movement, Libya        | Field Coordinator, Population Movement, Libya        |         |         |         |                   128 | rr   |                 |         23847 |        62 | t
  39.  120 | 2021-06-30 00:00:00+00 | 2021-09-29 00:00:00+00 | Bulliard, Jean-Marc       | Supply Chain Coordinator, Population Movement, Libya | Supply Chain Coordinator, Population Movement, Libya |         |         |         |                   120 | rr   |             165 |         23847 |        61 | t
  40. (9 rows)
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement