Complicated conditional SQL query
- by DevAno1
I'm not even sure if it's possible but I need it for my Access database. So I have following db structure :
Now I need to perform a query that takes category_id from my product and do the magic :
- let's say product belongs to console (category_id is in table Console)
- from console_types take type_id, where category_id == category_id
- but if product belongs to console_game (category_id is in table console_game)
- from console_game take game_cat_id, where category_id == category_id
I'm not sure if mysql is capable of such thing. If not I'm really f&%ranked up. Maybe there is a way to split this into 2,3 separate queries ?