mysql-error-1093

    1熱度

    1回答

    我做這樣說: UPDATE products SET products_image = (SELECT products_image FROM products WHERE products_id = 2) WHERE products_id = 3; ...但得到一個錯誤: ERROR 1093 (HY000): You can't s

    2熱度

    3回答

    我需要從表中刪除某些行。通過查詢發現哪些行必須被刪除。然而,it appears that you cannot do both operations (select and delete) in the same query: 目前,你不能從一個 表中刪除,並在子查詢中從同一個表 選擇。 所以我不能做到這一點: DELETE FROM telefono WHERE telefono_id I

    6熱度

    1回答

    我需要從mysql中的表中刪除重複的記錄。 所以我有一個表名「員工」字段EMPID,empname,empssn 爲獲得重複的記錄我寫了一個查詢 SELECT COUNT(empssn), empssn FROM employee GROUP BY empssn HAVING COUNT(empssn)>1 現在我想刪除重複記錄。因爲我寫的查詢是。 DELETE FR

    0熱度

    2回答

    百分比計算研究我有一個這樣的表: ItemID PersonID Score Percentage ========================================== 1 1 10 [ = 10/10+30 = 25%] 1 2 30 [ = 30/10+30 = 75%] 2 1 20 [ = 20/20+40 = 33%] 2

    1熱度

    1回答

    SELECT lott.id as lottery_id,lott.abbr,lott.currency,payments.id as payment_id, payment_prizes.prize_id,prizes.name,prizes.currency as prizes_currency FROM lotteries lott JOIN lottery_p

    2熱度

    2回答

    我有兩個腳本,一個用於插入,另一個用於更新。 我的更新按鈕腳本是採用了最新的插入的標識,並繼續是這樣的: Update tblsurvey set WouldLikeToBeSeenOnSite = 'sadffas' and DislikedOnSite = 'asdfsadfsadf' and OtherNewsWebsitesRead = 'asdfsadfa' and LikedO

    0熱度

    2回答

    我與this other question的情況相同,但我不想選擇行,我想更新這些行。 我用solution Scott Saunders made: select * from table where email in ( select email from table group by email having count(*) > 1 ) 這工作,但我想改變/更新這些條目行的值

    0熱度

    6回答

    DELETE FROM mytable WHERE id IN (SELECT id FROM mytable where roll=1) 我有一個表mytable。我上面的查詢是拋出一個錯誤。 您不能指定目標表「MYTABLE」的更新在FROM子句

    0熱度

    1回答

    我寫了這個查詢: delete from `test1` where id in ( SELECT id FROM `test1` GROUP BY m, n HAVING count(id) >1) 但MySQL允許這個錯誤: 「你不能指定目標表‘測試1’的更新在FROM子句」 爲什麼?我該如何解決它?

    38熱度

    7回答

    我試圖使用UPDATE更新表中一堆行中的列值。問題是我需要使用子查詢來派生這個列的值,並且它依賴於同一個表。這裏的查詢: UPDATE user_account student SET student.student_education_facility_id = ( SELECT teacher.education_facility_id FROM user_account