测试Test

Dev works always busy

This is a good event

Heading 1

Heading 2

Heading 3

Heading 4

text

Bold Text Test :smiling_face_with_horns:

Bold, Bold, ** not bold *, __ not bold__f__, not bold

Italic Test Test

italic, italic, * not talic *,_ not italic _, _ _ ,<(italic)>

Bold italics :candy:

粗斜体粗斜体2, 粗斜体,*** 不是粗斜体*** ___not botalics ___

Emojis

:coconut:, sized to row height

:hammer_and_wrench:: apple emoji

Full heights:
:tiger_face:
:tiger:
:blush:
Yes yes yes

Links

Go to my blogs

Now it’s clickable thumb taking us to here clickable thumb, also resizable.

Images

can be triggered by copying images here, auto on next line, resizable

support not upload thumb

Blockquotes

With a ligh of accent-colorish ribbon on the left.

quote some text in here
this is still in it
:building_construction::building_construction::building_construction:

now we exit block quotes, into the next

more robust
at line 2
and three

now we exit block quotes

Test code blocks

一些代码,使用sqlglot

import sqlglot

ast = sqlglot.parse_one(sql)
#include <iostream>

int main() {
    return 0;
}

yeah yeah why not more

-- Cohort retention & revenue by first-purchase month, with a recursive calendar
-- Requires (example schemas):
--   customers(customer_id, created_at)
--   orders(order_id, customer_id, order_date, amount, status)
-- Notes:
--   - Cancels/refunds excluded via status
--   - Dedupes accidental dup orders
--   - Fills missing dates with a recursive calendar
--   - Produces cohort-month (M0, M1, …) retention and revenue

WITH
-- 1) Parameters you can tweak in one place
params AS (
  SELECT
      DATE '2024-01-01'::date  AS start_date,
      DATE '2025-10-31'::date  AS end_date,
      ARRAY['cancelled','refunded']::text[] AS bad_statuses
),

-- 2) Calendar: one row per date (WITH RECURSIVE)
calendar AS (
  WITH RECURSIVE d AS (
    SELECT p.start_date AS dt
    FROM params p
    UNION ALL
    SELECT dt + INTERVAL '1 day'
    FROM d, params p
    WHERE dt + INTERVAL '1 day' <= p.end_date
  )
  SELECT dt::date AS dt
  FROM d
),

-- 3) Clean orders: drop bad statuses and dedupe identical (customer, datetime, amount)
--    keeping the earliest order_id per tie.
orders_clean AS (
  SELECT *
  FROM (
    SELECT
      o.*,
      ROW_NUMBER() OVER (
        PARTITION BY o.customer_id, o.order_date, o.amount
        ORDER BY o.order_id
      ) AS rn
    FROM orders o
    JOIN params p ON TRUE
    WHERE o.status IS DISTINCT FROM ANY (p.bad_statuses)
      AND o.order_date::date BETWEEN p.start_date AND p.end_date
  ) t
  WHERE rn = 1
),

-- 4) First order per customer (cohort anchor)
first_order AS (
  SELECT DISTINCT ON (oc.customer_id)
    oc.customer_id,
    oc.order_date::date AS first_order_date,
    date_trunc('month', oc.order_date)::date AS cohort_month
  FROM orders_clean oc
  ORDER BY oc.customer_id, oc.order_date
),

-- 5) Daily active purchasers: did the customer purchase on that day?
daily_purchasers AS (
  SELECT
    c.dt,
    oc.customer_id,
    1 AS purchased_flag,
    oc.amount
  FROM calendar c
  JOIN orders_clean oc
    ON oc.order_date::date = c.dt
),

-- 6) Daily cohort-aligned metrics: join each purchase back to its cohort anchor
daily_cohort_metrics AS (
  SELECT
    f.cohort_month,
    dp.dt AS activity_date,
    -- month offset from first purchase month (M0 = cohort month)
    (date_trunc('month', dp.dt) - f.cohort_month) / INTERVAL '1 month' AS month_offset,
    dp.customer_id,
    dp.purchased_flag,
    dp.amount
  FROM daily_purchasers dp
  JOIN first_order f
    ON f.customer_id = dp.customer_id
),

-- 7) Cohort sizes (denominator)
cohort_sizes AS (
  SELECT
    cohort_month,
    COUNT(DISTINCT customer_id) AS cohort_customers
  FROM first_order
  GROUP BY cohort_month
),

-- 8) Monthly rollups per cohort & offset: active users and revenue
cohort_monthly AS (
  SELECT
    dcm.cohort_month,
    dcm.month_offset::int AS month_offset,
    COUNT(DISTINCT dcm.customer_id) AS active_customers,
    SUM(dcm.amount) AS revenue
  FROM daily_cohort_metrics dcm
  GROUP BY dcm.cohort_month, dcm.month_offset
),

-- 9) Stitch sizes back in and compute retention, ARPU, LTV
cohort_final AS (
  SELECT
    cm.cohort_month,
    cm.month_offset,
    cs.cohort_customers,
    cm.active_customers,
    (cm.active_customers::numeric / NULLIF(cs.cohort_customers,0))::numeric(6,4) AS retention_rate,
    cm.revenue,
    (cm.revenue / NULLIF(cs.cohort_customers,0))::numeric(12,2) AS arpu,     -- revenue per original user
    SUM(cm.revenue) OVER (
      PARTITION BY cm.cohort_month
      ORDER BY cm.month_offset
      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
    ) / NULLIF(cs.cohort_customers,0)                                         AS ltv_cumulative
  FROM cohort_monthly cm
  JOIN cohort_sizes cs USING (cohort_month)
)

-- 10) Final report: one row per cohort-month-offset
SELECT
  cohort_month::date                                  AS cohort_month,
  CONCAT('M', LPAD(month_offset::text, 2, '0'))       AS month_bucket,
  cohort_customers,
  active_customers,
  retention_rate,     -- e.g., 0.4230 = 42.30%
  revenue,
  arpu,               -- revenue / original cohort size
  ltv_cumulative      -- running LTV since M0
FROM cohort_final
WHERE month_offset BETWEEN 0 AND 12
ORDER BY coh

this is unnamed block with default syntax highligh 

列表

  • 无序项目,实心圆

    • 无序项目一级缩进,空心圆
      • 无序项目二级缩进
        • 无序项目三级缩进,和二级一样是小方块
  • 无序项目(-也是)

  • 无序项目(+可混用)

  1. 有序列表项目,数字
  2. 有序列表项目 ,本身无法缩进,用无序缩进
    • First nested list item
      • Second nested list item

勾选

勾选可以直接在非编辑器中直接toggle

提及

Mentions 用户 @calvin,组群 @trust_level_0

引用这个帖子(Quote Topic)

The quote whole topic just quotes the first post in a topic in a bbcode style quoting, but since the first is an event, it cannot appear syntatically in the following posts in this topic.

Text Styles

There is a few missing…

上下标:102 = 100, 102 is not a equation.

穿过线,~非穿过线~

下划线

换行

金(直接换行,超过两行后上下方的忽略)


水(反斜杠)
火( 空格修剪,最后有好几个 )

分割线


Code text

code text is not interpreted ![Solo Devs Title|690x393, 75%](upload://4OBbDBcnS0OgxVGCZCpA99mgzoV.jpeg), rendered as-is.

Simple Table rendered

第 1 列 第 2 列
x mostly one line stuff
1. adf 2. xyz
z blick

Details

总结

此文本将被隐藏
:boar: