查询用select a.order_type,delivery_date,procedure_no from table_one a,table_two b where a.order_type=b.order_type
目前mysql还不支持select *** into table_three
你只好用create table的办法创建新表,然后再用insert into table_three select a.order_type,delivery_date,procedure_no from table_one a,table_two b where a.order_type=b.order_type
一定行的。

解决方案 »

  1.   

    先建临是表table_three
    select one.order_type,one.quantity,one.delivery_date,two.lot_no,two.procedure_no,two.machine_in,two.user_time into table_three from table_one as one left join table_two as two [where one.delivery_date > to_day(NOW())] order by one.order_type desc,one.delivery_date asc,two.procedure_no asc
      

  2.   

    对不起补充
    from table_one as one left join table_two as two on one.order_type=two.order_type
      

  3.   

    都说了mysql还不支持select *** into table_three语法,不要误人子弟。
      

  4.   

    binscut(binscut) 这样你能不能看懂?
    insert into table_three select one.order_type,one.quantity,one.delivery_date,two.lot_no,two.procedure_no,two.machine_in,two.user_time from table_one as one left join table_two as two on one.order_type=two.order_type
    [where one.delivery_date > to_day(NOW())] order by one.order_type desc,one.delivery_date asc,two.procedure_no asc
    order by one.order_type desc让'u'记录在前面