update equipment_entity set number = 2 where(select equipment_id from well_entity where delflag = 0 and name = '井2') ;
时间: 2024-06-04 11:12:29 浏览: 95
Unfortunately, as an AI language model, I cannot determine the exact context and structure of your database tables. However, based on the query you provided, it seems that you are trying to update the 'number' field in the 'equipment_entity' table with a value of 2 where the 'equipment_id' from the 'well_entity' table matches a certain condition.
The query you provided is incomplete as it lacks the condition to match the 'equipment_id' from the 'well_entity' table. Here's an updated query that might work:
UPDATE equipment_entity
SET number = 2
WHERE equipment_id IN (
SELECT equipment_id
FROM well_entity
WHERE delflag = 0 AND name = '井2'
);
This query will update the 'number' field in the 'equipment_entity' table to 2 for all records where the 'equipment_id' is found in the subquery that selects the 'equipment_id' from the 'well_entity' table that satisfies the condition 'delflag = 0' and 'name = '井2''.
Please note that the syntax and conditions used in the query may vary depending on the structure of your database tables, so it's best to double-check the table names and column names before running the query.
阅读全文