sql - How can I change this query into a subquery -


select c.name, c.tel customer c, vehicle c, hire h c.cid=h.cid , v.vid = h.vid , (dropoff-pickup) > 1 , v.make = 'suzuki' 

dropoff , pickup date fields

select c.name, c.tel customer c join hire h on c.cid = h.cid join vehicle v on h.vid = v.vid v.make = 'suzuki'  , (h.dropoff-h.pickup) > 1 

not answer question don't need subquery here please structure query make more obvious trying (you getting customer name , telephone number vehicles make suzuki length of hire longer 1 day right?)

structuring queries make more readable people don't know trying , make finding mistakes in query logic easier or others


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -