SELECT ps.job_no, ps.booking_no,
ps.type,ps.shipped_by, ps.invoice_no,
ps.transporters_id,ps.clients_id,ps.return_terminal,
ps.destinations_id,ps.forwarder_name,
containers.container_size,containers.container_no,
containers.truck_no,
ps.driver_cell_no,ps.shipping_line_name,
containers.cro_no,vessels.vessel_name,vessels.eta,
containers.empty_pickup_point,containers.loading_point,
ps.particular
FROM planning_sheet AS ps
LEFT JOIN vessels
ON vessels.bookingno= ps.booking_no
LEFT JOIN containers
ON containers.bookingno = ps.booking_no
GROUP BY ps.clients_id
我是构建此类复杂查询的新手,查询定义如下,我想要在此查询中针对“clients_id”的所有记录我得到针对此查询的一条记录。
我还想在“type = 0”时写“Air”或“type =1”而不是在“type”列中写“Sea”。