select *,(select count(u_id) from h_travel_line where u_id = a.u_id) 已线路数from h_travel a如此便可
SELECT c.ttt AS 已线路数, h_travel.*FROM h_travel INNER JOIN(SELECT COUNT(*) AS ttt, u_idFROM h_travel_lineGROUP BY STID) c ON h_travel.u_id =c.u_id