UPDATE questions in SQL.

Updated on technology 2024-02-08
5 answers
  1. Anonymous users2024-02-05

    Since you don't know the primary key in your t hy cus install table, it's safer to use exists.

    update t_hy_cus_install t setwhere exists( select 1from t_hy_cus_install t1, t_hy_cus_install_detail t2

    where =

    and <>2

    and like'%n2%' and

    and and

    and and= ;

  2. Anonymous users2024-02-04

    update t_hy_cus_install hmjx=1 where install_bill_id in (select ,from t_hy_cus_install t1, t_hy_cus_install_detail t2

    where =

    and <>2

    and like'%n2%')

    That's it, look at the tables in your database.

  3. Anonymous users2024-02-03

    Actually, it's very simple, replace everything from before: update t1 set'1', the whole is as follows:

    update t1 set '1'

    from t_hy_cus_install t1, t_hy_cus_install_detail t2

    where =

    and <>2

    and like'%n2%'

  4. Anonymous users2024-02-02

    Your sentence is too confusing, and you need to be clear about a few points according to what you mean.

    1.If you use table B data to update table A, what is the where condition, that is, what data in table A is updated and what data is used in table B, and what is the relationship between the two. I can't see the correlation between table b and table a from your statement.

    2.After the association condition is found, whether the data in table b is unique or not, the error "more than one line of return value" will still occur.

    According to the structure and data of your table, assuming that the name column in table A and table B is unique, and the name is used as the association, you can write it like this to achieve your update purpose:

    update a set cou2 = (select b_cou1 from b where = where name in (select b_name from b where =

    This statement must meet the unique condition that the name is in tables A and B before it can be used.

  5. Anonymous users2024-02-01

    cou2=(select b cou1 from b where(condition 1)) where name=(select b name from b where(condition 1)).

    select b cou1 from b where(condition 1) This subquery can have only one record.

    It can be changed to: update a a set cou2=

    where exists

    select * from b b where b name = and (condition 1)).

Related questions
4 answers2024-02-08

select * from log a,(select ,max(date) from logwhere id='10000' >>>More

9 answers2024-02-08

There are some small misunderstandings, even if you lock BL, you can't find the location of the phone, it's very simple, just turn it off. >>>More

10 answers2024-02-08

All of them are just different expressions

2 answers2024-02-08

The members of the Xin Orchestra are composed of the head and drummer Huang Mike, the lead singer Liu Wenjie, the guitarist Sun Zhiqun, the bassist Liu Xiaohua, and the keyboardist Fu Chaohua怂In 2002, the orchestra was initially led by Su Jianxin, and launched the first **** letter orchestra with the same name**, thus officially debuting. In 2004, he starred in the biographical idol drama Death Must Love. >>>More

15 answers2024-02-08

Refers to Dayu's water control, and Dayu's contributions.