我试图将一个删除语句重写为一个select语句,但我不断收到错误。这是我试图重写的删除语句:
DELETE row1 FROM tableName row1, tableName row2 WHERE (row1.id > row2.id) AND (row1.col1 = row2.col1) AND (row1.col2 = row2.col2)
这是我试图写的select语句:
SELECT row1 FROM tableName row1, tableName row2 WHERE (row1.id > row2.id) AND (row1.col1 = row2.col1) AND (row1.col2 = row2.col2)
^ ---是的,这是完全错误的,但我不确定如何解决它。
答案 0 :(得分:1)
使用'*'指定应选择所有列,例如
SELECT * FROM tableName row1, tableName row2
WHERE (row1.id > row2.id) AND (row1.col1 = row2.col1) AND (row1.col2 = row2.col2)