0

Есть две таблицы t1 и t2.

t1

| user_id | nick | message | 
|    -    |user_1|  text   |
|    -    |user_2|  text   |
 

t2

 | user_id | nick | 
 |    23   |user_1|
 |    45   |user_2|

Какой сформировать запрос, чтобы заполнить столбец user_id в t1, используя данные t2? Спасибо.

1 ответ 1

3

Вроде так

update t1 
inner join t2 on
    t1.nick = t2.nick
set t1.user_id = t2.user_id

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.