Prices in ZXDB
Posted: Tue Apr 16, 2019 10:44 am
Inspired by the thread about most expensive Spectrum software:
viewtopic.php?f=21&t=1463
I tried to search such releases directly in ZXDB database.
That's what I came with:
SELECT R.release_price, E.*
FROM entries E
INNER JOIN releases R ON E.id=R.entry_id
ORDER BY R.release_price DESC
The problem is that this sorting doesn't really work as supposed. Release_price in the database is not a number, it's a string. So I get list like this:
The order is wrong, also the column contains values in different currencies so it doesn't make sense to compare pounds to pesetas.
The proper way from database point of view, I guess, would be to hold pure numbers in one column and currency_id in another column
Is there any better way to get games sorted by a price?
[mention]Einar Saukas[/mention] I recall you did some work on ZXDB prices. Do you have any future plans about it?
viewtopic.php?f=21&t=1463
I tried to search such releases directly in ZXDB database.
That's what I came with:
SELECT R.release_price, E.*
FROM entries E
INNER JOIN releases R ON E.id=R.entry_id
ORDER BY R.release_price DESC
The problem is that this sorting doesn't really work as supposed. Release_price in the database is not a number, it's a string. So I get list like this:
The order is wrong, also the column contains values in different currencies so it doesn't make sense to compare pounds to pesetas.
The proper way from database point of view, I guess, would be to hold pure numbers in one column and currency_id in another column
Is there any better way to get games sorted by a price?
[mention]Einar Saukas[/mention] I recall you did some work on ZXDB prices. Do you have any future plans about it?