update order_t set ord_joi_id=(select joi_id from join_t,order_t where order_t.ord_startpoi_id=join_t.joi_startpoi_id and order_t.ord_endpoi_id=join_t.joi_endpoi_id) where ord_id="+id
插入时候报错
join_t结构
 joi_id             NUMBER(20)       
   joi_startpoi_id    NUMBER(20),
   joi_endpoi_id      NUMBER(20),
   joi_cla_id         NUMBER(20),
   joi_status         VARCHAR2(10)   
   joi_time           DATE
order_t结构
ord_id             NUMBER(20)                      not null,
   ord_startpoi_id    NUMBER(20),
   ord_endpoi_id      NUMBER(20),
   ord_joi_id         NUMBER(20),
   ord_use_id         NUMBER(20),
   ord_goodsname      VARCHAR2(20)                    not null,
   ord_receiver      VARCHAR2(30)                    not null,
   ord_city varchar2(200)   not null,
   ord_receiveaddress VARCHAR2(200)                   not null,
   ord_receivephone   VARCHAR2(20)                    not null,
   ord_sender         VARCHAR2(30)                    not null,
   ord_sendaddress    VARCHAR2(200)                   not null,
   ord_sendphone      VARCHAR2(20)                    not null,
   ord_weight         NUMBER                          not null,
   ord_volume         NUMBER                          not null,
   ord_time           DATE                            not null,
   ord_goodsdescribe  VARCHAR2(100)                   not null,
   ord_status         VARCHAR2(10)                    not null,
   ord_price          NUMBER                          not null,
   ord_statrtprice    NUMBER,
   ord_endprice       NUMBER,

解决方案 »

  1.   

    select joi_id from join_t,order_t where order_t.ord_startpoi_id=join_t.joi_startpoi_id and order_t.ord_endpoi_id=join_t.joi_endpoi_id
    你这个语句查出来有好多结果的 你到底是要用哪个?select joi_id 
    from join_t,order_t 
    where order_t.ord_startpoi_id=join_t.joi_startpoi_id 
    and order_t.ord_endpoi_id=join_t.joi_endpoi_id
    and rownum=1
      

  2.   

    不是写的很明白么,单行子查询返回多行,检查你的select语言的返回值。