Advertisement
Guest User

Query Example

a guest
Feb 2nd, 2024
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. (
  2. select
  3. `opex_budget`.`id` as `opex_budget___id`,
  4. `opex_budget`.`opex_id` as `opex_budget___opex_id`,
  5. `opex_budget`.`currency_code` as `opex_budget___currency_code`,
  6. `opex_budget`.`forecast` as `opex_budget___forecast`,
  7. `opex_budget`.`value` as `opex_budget___value`,
  8. `opex_budget`.`comment` as `opex_budget___comment`,
  9. NULL AS `parent_cost_centre___id`,
  10. NULL AS `parent_cost_centre___target_id`,
  11. NULL AS `parent_cost_centre___target_type`,
  12. NULL AS `parent_cost_centre___target_bundle`,
  13. NULL AS `total_budget_value___id`,
  14. NULL AS `year___id`,
  15. NULL AS `year___target_id`,
  16. NULL AS `year___target_type`,
  17. NULL AS `year___target_bundle`
  18. from
  19. `field_opex_cost_summary__opex_budget` as `opex_budget`
  20. where
  21. (
  22. `entity_id` = 111
  23. and `entity_type` = 'budget'
  24. and `entity_bundle` = 'record'
  25. )
  26. )
  27. union
  28. (
  29. select
  30. NULL AS `opex_budget___id`,
  31. NULL AS `opex_budget___opex_id`,
  32. NULL AS `opex_budget___currency_code`,
  33. NULL AS `opex_budget___forecast`,
  34. NULL AS `opex_budget___value`,
  35. NULL AS `opex_budget___comment`,
  36. `parent_cost_centre`.`id` as `parent_cost_centre___id`,
  37. `parent_cost_centre`.`target_id` as `parent_cost_centre___target_id`,
  38. `parent_cost_centre`.`target_type` as `parent_cost_centre___target_type`,
  39. `parent_cost_centre`.`target_bundle` as `parent_cost_centre___target_bundle`,
  40. NULL AS `total_budget_value___id`,
  41. NULL AS `year___id`,
  42. NULL AS `year___target_id`,
  43. NULL AS `year___target_type`,
  44. NULL AS `year___target_bundle`
  45. from
  46. `field_relationship__parent_cost_centre` as `parent_cost_centre`
  47. where
  48. (
  49. `entity_id` = 111
  50. and `entity_type` = 'budget'
  51. and `entity_bundle` = 'record'
  52. )
  53. )
  54. union
  55. (
  56. select
  57. NULL AS `opex_budget___id`,
  58. NULL AS `opex_budget___opex_id`,
  59. NULL AS `opex_budget___currency_code`,
  60. NULL AS `opex_budget___forecast`,
  61. NULL AS `opex_budget___value`,
  62. NULL AS `opex_budget___comment`,
  63. NULL AS `parent_cost_centre___id`,
  64. NULL AS `parent_cost_centre___target_id`,
  65. NULL AS `parent_cost_centre___target_type`,
  66. NULL AS `parent_cost_centre___target_bundle`,
  67. `total_budget_value`.`id` as `total_budget_value___id`,
  68. NULL AS `year___id`,
  69. NULL AS `year___target_id`,
  70. NULL AS `year___target_type`,
  71. NULL AS `year___target_bundle`
  72. from
  73. `field_calculated__total_budget_value` as `total_budget_value`
  74. where
  75. (
  76. `entity_id` = 111
  77. and `entity_type` = 'budget'
  78. and `entity_bundle` = 'record'
  79. )
  80. )
  81. union
  82. (
  83. select
  84. NULL AS `opex_budget___id`,
  85. NULL AS `opex_budget___opex_id`,
  86. NULL AS `opex_budget___currency_code`,
  87. NULL AS `opex_budget___forecast`,
  88. NULL AS `opex_budget___value`,
  89. NULL AS `opex_budget___comment`,
  90. NULL AS `parent_cost_centre___id`,
  91. NULL AS `parent_cost_centre___target_id`,
  92. NULL AS `parent_cost_centre___target_type`,
  93. NULL AS `parent_cost_centre___target_bundle`,
  94. NULL AS `total_budget_value___id`,
  95. `year`.`id` as `year___id`,
  96. `year`.`target_id` as `year___target_id`,
  97. `year`.`target_type` as `year___target_type`,
  98. `year`.`target_bundle` as `year___target_bundle`
  99. from
  100. `field_category__year` as `year`
  101. where
  102. (
  103. `entity_id` = 111
  104. and `entity_type` = 'budget'
  105. and `entity_bundle` = 'record'
  106. )
  107. )
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement