Skip to content

Instantly share code, notes, and snippets.

View Abhijeetsng97's full-sized avatar
🎯
Focusing

Abhijeet Singh Abhijeetsng97

🎯
Focusing
View GitHub Profile
SELECT
invoice.customer_id,
invoice_line_item.id invoice_line_item_id,
invoice_line_item.invoice_id invoice_id,
plan.id plan_id,
plan.amount actual_plan_amount,
plan.interval plan_interval,
CASE
WHEN plan.interval = "year" THEN
plan.amount/12
CREATE TEMP FUNCTION
get_priority(txn_type string)
RETURNS int64 AS (
IF
(txn_type LIKE '%DR%',
1,
0));
CREATE TEMP FUNCTION
capitalize(str STRING) AS ((
SELECT