FunkyBunch
Instructor
Hello All,
I am currently creating a view to select the equipment id, the count of how many times it is in the table, the vehicle it was attached to before
Here is my sql:
Select access_equip_fw as ME_ID, count(access_equip_fw)"count(access_equip_Fw)",
(select top 1 vehicle_id_Fw from user_Defined20_Fw order by date_mounted_equipment_added_fw desc)
from user_Defined20_Fw
group by access_equip_fw
Here is my current output:
100 1 1171
1000 1 1171
1002 1 1171
What i want is:
100 1 5<vehicle attached to before this one>
1000 1 4<vehicle attached to before this one>
1002 1 95<vehicle attached to before this one>
I am currently creating a view to select the equipment id, the count of how many times it is in the table, the vehicle it was attached to before
Here is my sql:
Select access_equip_fw as ME_ID, count(access_equip_fw)"count(access_equip_Fw)",
(select top 1 vehicle_id_Fw from user_Defined20_Fw order by date_mounted_equipment_added_fw desc)
from user_Defined20_Fw
group by access_equip_fw
Here is my current output:
100 1 1171
1000 1 1171
1002 1 1171
What i want is:
100 1 5<vehicle attached to before this one>
1000 1 4<vehicle attached to before this one>
1002 1 95<vehicle attached to before this one>