Skip to content

Instantly share code, notes, and snippets.

@MikeRzhevsky
Created March 5, 2022 18:49
Show Gist options
  • Save MikeRzhevsky/379a339f4b61e406080ee2f884f1f29b to your computer and use it in GitHub Desktop.
Save MikeRzhevsky/379a339f4b61e406080ee2f884f1f29b to your computer and use it in GitHub Desktop.
select indi.customer_id
from clickhouse.cifra.ct_privilege_cards__calculated_indicators as indi
WHERE NOT EXISTS
(SELECT dbt_statuses."покупатель"
from cifratest.dbt_stage."dm_stage_регистрсведений_статусыкартprivilege" as dbt_statuses
where indi.customer_id = dbt_statuses."покупатель"
and indi.redeem_percentage = dbt_statuses."процентвыкупа"
and indi.redeem_amount = dbt_statuses."суммавыкупа"
and indi.cancelled_orders_amount = dbt_statuses."суммаотказов"
and indi.ordered_basic_goods_qty = dbt_statuses."заказаноcущественныхтоваров"
)
limit 100
-- SQL Server did not return a response. The connection has been closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment