, and the ID value is the maximum value of the table plus 1, so we will write about the following statement: MySQL>insertintovalues((selectmax from T1), ' You ' );
1093 (HY000): You can"T1' for update in from clauseStill reported the same mistake. Can be rewritten as follows: Mysql> Insert intoT1Select(Select Max(ID)+1Papi sauce fromT1),' You'; Query OK,1Row affected (0.06sec) Records:1Duplicates:0Warnings:0MySQL> Select * fromT1;+------+------+
|
Figure exercise-bfs-the shortest number of steps from the start to the target point
Time limit:1000ms Memory limit:65536k have questions? Dot here ^_^
Title description in the ancient Warcraft legend, there are two legions, one called the Scourge, one called Janissary. In their area, there are n passes, numbered 1. N, there is a channel connection between some passes. Among them, the Legion was in the 1th, and the Scourge was in the N
Label: UPDATEBpm_tksign_dataSETIsCompleted= 1
WHEREActinstid= '10000002433415'
andNodeid= 'SignTask1'
andIsCompleted= 0
andBatch= (
SELECT
Max(A.batch) m fromBpm_tksign_data aWHEREA.actinstid= '10000002433415'
andA.nodeid= 'SignTask1'
); This type of writing, MySQL versions are not supported. UPDATEBpm_tksign_dataSETIsCompleted= 1
WHEREActinstid= '10000002433415'
andNodeid= 'SignTask1'
andIsCompleted= 0
andBatch= (
SELECT
Max(A.batch) m from
(SELECT *
Tag: Django
dele_id=Fee_details_invoices.objects.filter(fee_detail_id__in=fee_id_list,return_type=‘2‘).values_list(‘fee_detail_id‘,flat=True)Fee_details_invoices.objects.filter(fee_detail_id__in=dele_id).delete()
Error:
django.db.utils.DatabaseError:(1093,"Youcan‘tspecifytargettable‘fee_details_invoices‘forupdateinFROMclause")
Error analysis solution:
The first line of code indicates obtaining a field in some condition rows.
The second line of code deletes records that contain this field value
Chkpt
MANAGER RUNNINGExtract stopped DPUMP1 00:00:00 00:00:11Extract stopped EXT1 00:00:00 00:00:09
-- Target orcltest-- Check that the replication process is running and stops the process:GGSCI (localhost. localdomain) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNINGReplicat running REP1 00:00:00
GGSCI (localhost. localdomain) 9> stop *
Sending STOP request to REPLICAT REP1...Request processed.
-- Source orcl-- Add a
In mysql, user information is intercepted cyclically and inserted into the corresponding fields of the target table. mysql user information
Operating Environment: Table game_list, field: uid, score1, score2, seat_id, last_update;The input parameter is I _player_detail. The input value is the id, previous score, post score, and seat number of multiple users. Data
Datastage obtains the number of records inserted into the target table by analyzing logs.
This is only a bad method, and there may be better and easier methods. This method requires that the existing log information be deleted before each job is run. Otherwise, the correct number of records cannot be counted. Of course, after the job is run, you can back up the logs of this job to the server disk in shell
Duplicate records in a delete table using MySQLDelete from the user where username in (select the User name form (select username from the user group by username have count (usernam e) (>1));Encounter MySQL error you can ' t specify target table to update in FROM clauseInternet Baidu is the original MySQL is not allowed to select out some values in the same
SELECT from Sys_userResults:The Create_user_uin_tree in the table identifies who created the record.When creating a new user, the following SQL is available based on the UIn of the currently logged on user and the newly created user uin:Select concat (ifnull (Create_user_uin_tree,concat ('_',2,' _ '),'|_', ' a', ' _ ') from where uin=2Results:Then the modified Create_user_uin_tree's identity SQL is:UpdateSys_userSetCreate_user_uin_tree=(SelectConca
MySQL in your can ' t specify target table for update in FROM clause error means that you cannot select some of the values in the same table first, and then update the table (in the same statement). For example, the following SQL:12(3 select max (ID) from TBL A where EXISTS4 (5 Select 1 from
Label:MySQL in your can ' t specify target table for update in FROM clause error means that you cannot select some of the values in the same table first, and then update the table (in the same statement). For example, the following SQL: The code is as follows: Delete from the TBL where ID in ( Select Max (ID) from TBL
Tags: 02055 02049 02063Symptom: 02055 02049 02063 06512 error reported in Target library during stored procedureTroubleshooting process:1. Querying the 110 rows of the stored procedure is just a simple delete action2, through the following SQL statement to find the deadlock, no deadlockSELECT ' alter system kill session ' | | Chr (39) | | l.session_id| | ', ' | | s.serial#| | Chr (39) | | immediate; ', l.session_id sid,s.serial#,l.locked_mode,l.oracle
Mysql error: 1093-You can't specify target table for update in FROM clause solution, please 3-youclause
Problems Found
Recently, when processing data in some databases, I wrote the following SQL statement:
UPDATE f_studentSET school_id = 0WHERE id > ( SELECT id FROM f_student WHERE school_id = M LIMIT 1 )AND id
The preceding SQL statement is used to modify the data in a certain interval, but runs in a test
Label:MySQL in your can ' t specify target table The following l:You can circumvent the error by needing to select the result of the search again through the intermediate table select again.As follows:PS: This issue only occurs on Mysql,sql service and Oracle does not occur.MySQL in your can ' t specify target
Tags: Sele style core col ROM statement from code where Delete from student
where not in (
Selectmin from Group by name,stuid,subid,subname,score
); When executing this statement in MySQL, an error occurred: You can ' t specify target table ' student ' for update in FROM clause; The reason is that the subquery uses the Student table to query, the outer layer
MySQL in your can ' t specify target table Delete fromTblwhereIdinch ( Select Max(ID) fromTBL Awhere EXISTS ( Select 1 fromTBL BwhereA.tac=B.tacGroup byTac having Count(1)>1 ) Group byTAC)Rewrite it to the following line:Delete fromTblwhereIdinch ( Selecta.ID from ( Select Max(ID) ID fromTBL Awhere EXISTS ( Select 1 fromTBL BwhereA
Unlike Oracle and Sqlserver,mysql, which do not support querying the data of a table and querying for the updated condition, we need to use the following statement bypass:UPDATETeaching_departmentSETCode_year= ., Notice_code=(SELECTA.code+ 1 from(SELECT MAX(Notice_code) Code fromTeaching_departmentWHEREdepartment_id= 6284 andCode_year= .AWHEREId= 106;Local tests are passed, but when you go up to the test environment, you will still see the followi
MySQL in the can ' t specify target table for update in the FROM clause error means that you cannot select some of the values in the same table first, and then update the table (in the same statement). For example, the following SQL:
Copy Code code as follows:
Delete from tbl where ID in
(
Select Max
Today in writing MySQL encountered a more specific problem.
The MySQL statement is as follows:
Update Wms_cabinet_form Set Cabf_enabled=0
where cabf_id in (
SELECT wms_cabinet_form.cabf_id from Wms_cabinet_form
Inner Join wms_cabinet on wms_cabinet_form.cabf_cab_id = wms_cabinet.cab_id
Inner Join Wms_cabinet_row on wms_cabinet.cab_row_id =wms_cabinet_row.row_id
where wms_cabinet_row.row_site_id=27 and Wms_cabinet_form.cabf_enabled=1)
The runtime presents the following prompts: You can ' t spec
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.