這句SQL附近語法錯誤如何修改

2022-11-08 08:06:25 字數 947 閱讀 9863

1樓:glad大明白

delete from t_paiban where id in ( num='103' and theweek='40')

你要明白delete 後面條件是什麼意思。

id in(id的集合),那麼你現在 ( num='103' and theweek='40')這部是id的集合,也是不成立的等式條件,delete from t_paiban where id in (select id from t_paiban where num='103' and theweek='40')這樣就ok

2樓:匿名使用者

in是表示在某一個範圍內,id與這兩個欄位都不是同一型別的,怎麼用in呢?

如果你是要直接刪除t_paiban 表裡 num='103' and theweek='40'這條資料,就直接用

delete from t_paiban where num='103' and theweek='40'

如果是要刪除t_paiban 表id在另外一個表 num='103' and theweek='40'的資料,就用

delete from t_paiban where id in(select id from 另一表名 wherer num='103' and theweek='40')

3樓:匿名使用者

delete from t_paiban where id in ( select id from [關聯表] where num='103' and theweek='40')

4樓:

num=103試試 數字不需要加引號的 字元型才要

5樓:翼帆

delete from t_paiban where num='103' and theweek='40'

sql語法錯誤

這樣應該沒問題的 如果你說的a.rem是text型的話 勸你修改資料型別 你這樣寫,如果b表沒有值就查詢不到 select a.rem,sum select b.qty from b where b.ps no a.ps no from a group by a.rem 你可以把這個兩個表的內容寫上...

急!求翻譯這句話,無語法錯誤

你認為學校應該培養怎麼樣的學生?how do you think that school should cultivate their students in your opinion how should the school train their students how do you thi...

請幫忙檢查語法錯誤

1.i will never forget in my life i would never forget in my life 2.later change my mind later changed my mind 3.once 去掉 4.who sit near by who sat near...