Help about MySQL Query
#1

Hi guys,

I want to delete all Vehicles which are not on player slot's.For all players I store ID of vehicle:
Код:
Vehicle1
Vehicle2
Vehicle3
Vehicle4
Vehicle5
And I have another table for Vehicle.
Код:
ID
So If an of ID(From Vehicle) is not on any player slot I want to delete them.Because sometime's we are just delete car from slot and not from table Vehicle.Because I will change system I need to delete all vehicles which are not on player slot and I don't know how to do it.
Reply
#2

I'm found way to SELECT all Vehicles which are on player slot..But I need to delete vehicles which are not on any slot...

Код:
SELECT bu.ID FROM vehicle bu inner join users u where u.Vehicle1 = bu.ID || u.Vehicle2 = bu.ID || u.Vehicle3 = bu.ID || u.Vehicle4 = bu.ID || u.Vehicle5 = bu.ID
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)