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