I have two tables as below :
vehicles :
vehicle_id number_plate
1 B 101 RA
2 B 501 JU
3 B 401 JA
4 B 201 RU
team :
team_id team_name available_vehicles
1 A-001 1,2
2 A-002 NULL
3 A-003 4
I want to get value where the position of vehicle in the team table, my desired output would look like this:
vehicle_id ║ number_plate ║ team_name
1 ║ B 101 RA ║ A-001
2 ║ B 501 JU ║ A-001
3 ║ B 401 JA ║ NULL
4 ║ B 201 RU ║ A-003