SlothStyle@lemmy.worldtoAndroid@lemmy.world•Is there a community for Android games?English
4·
1 year agoIt’s so hard to find decent Android games. Would love somewhere that discusses good ones
It’s so hard to find decent Android games. Would love somewhere that discusses good ones
That sounds kind of like putting business logic in your data layer. I generally try to avoid that but you could do something like
SELECT ( :Doodads_amt * case when id=:doodad_id then price else 0 end ) + (:whatzits_amt * case when id=:whitzits_id then price else 0 end ) from components where component id in (:doodad_id, :whatzits_id);
That’s probably not exactly it but you can work with the case statements to filter the data you need. I can’t remember off the top of my head what you want in your else statement
The words with a colon at the front are bind variables.
What might be easier is to just query for the price of each item then multiply that price by an amount in your API.
Let me know if you have questions.