• Edge db

  • Prql

    • https://news.ycombinator.com/item?id=34181319
    from invoices
    filter invoice_date >= @1970-01-16
    derive [
      transaction_fees = 0.8,
      income = total - transaction_fees
    ]
    filter income > 1
    group customer_id (
      aggregate [
        average total,
        sum_income = sum income,
        ct = count,
      ]
    )
    sort [-sum_income]
    take 10
    join c=customers [==customer_id]
    derive name = f"{c.last_name}, {c.first_name}"