gpt4 book ai didi

MySQL 查询检查

转载 作者:行者123 更新时间:2023-11-29 09:18:01 25 4
gpt4 key购买 nike

这个查询有什么问题?

INSERT INTO table1 VALUES id, pic0, pic1, pic2, pic3, pic4 FROM table2 WHERE condition1 = 'cond1' AND condition2 = 'cond2' AND age = '18' AND ( weight = '100 - 115 lbs' OR weight = '115- 130 lbs' ) AND hairlength <> 'short'

条件适用于表2。我想将表 2 中满足 WHERE 子句后设置的条件的行插入到表 1 中。

谢谢你

最佳答案

我想你想要:

INSERT INTO table1 (id, pic0, pic1, pic2, pic3, pic4)
SELECT id, pic0, pic1, pic2, pic3, pic4
FROM table2
WHERE condition1 = 'cond1'
AND condition2 = 'cond2' AND age = '18'
AND ( weight = '100 - 115 lbs' OR weight = '115- 130 lbs' )
AND hairlength <> 'short'

关于MySQL 查询检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3467686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com