updates
This commit is contained in:
parent
e4653a3bea
commit
1c45b59db7
1 changed files with 43 additions and 0 deletions
|
@ -210,6 +210,49 @@ https://www.topdecked.com/decks/alive/833c308f-219f-4624-8b32-1adedcb477f0
|
|||
|
||||
: Deck = Deck [PreferredCard]
|
||||
|
||||
* Collection stats
|
||||
#+begin_src sql
|
||||
SELECT COUNT("copies"."id") AS cards
|
||||
, SUM(
|
||||
CASE WHEN "copies"."isFoil"
|
||||
THEN "card_prices"."usd_foil"
|
||||
ELSE "card_prices"."usd"
|
||||
END
|
||||
) AS value
|
||||
, COUNT(DISTINCT cards.set_code) AS sets
|
||||
FROM "copies"
|
||||
JOIN "cards" USING ("scryfall_id")
|
||||
LEFT JOIN "card_prices" USING ("scryfall_id")
|
||||
WHERE "card_prices"."date" = (SELECT "value" FROM "vars" where "key" = 'last_update')
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| cards | value | sets |
|
||||
|-------+---------+------|
|
||||
| 12871 | 7289.44 | 161 |
|
||||
|
||||
#+begin_src sql
|
||||
SELECT COUNT("copies"."id") AS cards
|
||||
FROM "copies"
|
||||
JOIN "cards" USING ("scryfall_id")
|
||||
LEFT JOIN "card_prices" USING ("scryfall_id")
|
||||
WHERE "card_prices"."date" = (SELECT "value" FROM "vars" where "key" = 'last_update')
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| cards |
|
||||
|-------|
|
||||
| 12871 |
|
||||
|
||||
#+begin_src sql
|
||||
select count(*) from copies
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| count |
|
||||
|-------|
|
||||
| 12871 |
|
||||
|
||||
* Identifying and ordering sets
|
||||
#+name: sets
|
||||
#+begin_src sql
|
||||
|
|
Loading…
Reference in a new issue