Question: Can someone help me, i don't know why my SQL script wont run? can any one see why?
Here it is

```
SELECT
     vi.`id` as 'VehicleId', vi.`class_type` as 'VehicleClass',vi.`registration_number` as 'VehicleRegistrationNumber',
     vr.`role_name` as 'VehicleRole',
     vm.`name` as 'VehicleMake',
     vmo.`name` as 'VehicleModel',
     ud.`name` as 'Depot location',

WHERE vehicle_role = 'High Volume Jet Vac'

FROM 
   unify_rebuild.vehicle_information as vi

LEFT JOIN 
  unify_rebuild.vehicle_role as vr
ON
  vi.unit_role = vr.role_id

LEFT JOIN
  unify_rebuild.vehicle_manufacturer as vm
ON
  vi.make = vm.id

LEFT JOIN
  unify_rebuild.vehicle_model as vmo
ON
  vi.model = vmo.id

LEFT JOIN
  unify_rebuild.unify_depot as ud
ON
  vi.depot_current_location = ud.id

```

I am trying to make one master table by joining data into the one so i can then display it on my web app, if anyone can see anything wrong i would greatly appreciate some pointers.

Answer: 
Have you tried to execute your query? I'm pretty sure that you'll receive some interesting errors in order to fix it.

The WHERE clause needs to be at the end of your query (after FROM and the JOINS) and you need to remove the last comma of your SELECT statement.
If you got still error's please check all the column names in your database or use "SELECT \*. The where clause is also with the prefix "*unify\_rebuild.*" - maybe this helps:

```
SELECT
vi.id as 'VehicleId', 
vi.class_type as 'VehicleClass',
vi.registration_number as 'VehicleRegistrationNumber',
vr.role_name as 'VehicleRole',
vm.name as 'VehicleMake',
vmo.name as 'VehicleModel',
ud.name as 'Depot location'

FROM 
   unify_rebuild.vehicle_information as vi
LEFT JOIN 
  unify_rebuild.vehicle_role as vr
ON
  vi.unit_role = vr.role_id
LEFT JOIN
  unify_rebuild.vehicle_manufacturer as vm
ON
  vi.make = vm.id
LEFT JOIN
  unify_rebuild.vehicle_model as vmo
ON
  vi.model = vmo.id
LEFT JOIN
  unify_rebuild.unify_depot as ud
ON
  vi.depot_current_location = ud.id
WHERE 
  unify_rebuild.vehicle_role = 'High Volume Jet Vac'

```