I have the following tables:
Transfers Table:
ID | storagefrom | storageto
1 | 2 | 3
Storages Table:
ID | Name
2 | Kitchen
3 | Main
I want to get the following result:
Storage1 | Storage2
Kitchen | Main
This is my query:
SELECT storages.name as Storage1, storages.name as Storage2
FROM transfers
LEFT JOIN storages ON storages.id = transfers.storagefrom
LEFT JOIN storages ON storages.id = transfers.storageto
Any tips?