WHERE with boolean-style integer flag
Before I close the month — pull every un-posted journal entry (`posted = 0`). Return `txn_id`, `txn_date`, `account_id`, `amount`, and `description`. I need to chase each one down with the originator.
| Column | Type | Key |
|---|---|---|
| txn_id | INT | PK |
| txn_date | TEXT | |
| account_id | INT | FK → dim_accounts |
| cost_center_id | INT | FK → dim_cost_centers |
| vendor_id | INT | FK → dim_vendors |
| amount | REAL | |
| currency | TEXT | |
| description | TEXT | |
| posted | INT | |
| posted_date | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
The transaction table has a flag that distinguishes posted from un-posted entries. Daniel wants to review everything that hasn't been confirmed to the ledger yet.
Daniel needs: txn_id, txn_date, account_id, amount, and description — enough context to chase each entry with the originator.
No ORDER BY requirement, but `ORDER BY txn_date` makes the review easier.