in pare>select * from
1. An error
ERROR 1241 (21000): Operand should contain 1 column(s)
2. The reason for the error
This statement occurs mostly because the result set of a SELECT is wrapped in (). ()
code> s>t
select
pit_key
,employee_code
,department_id
,value_date
from pit_employee_department ped
where ped.employee_code = 'GSCQ3349'
and ped.value_date < date_format(date_sub(curdate(), interval day(curdate()) - 1 day),'%Y%m%d')
and ped.pit_key not in
( select
pit_key
,value_date
from pit_employee_department ped_1
inner join
(
select
max(value_date) as max_date
from pit_employee_department ped
where ped.value_date <= date_format(date_sub( date_sub(curdate(), interval day(curdate()) - 1 day),interval 1 month),'%Y%m%d')
and employee_code = 'GSSH0039'
)ped_2
on ped_1.value_date < ped_2.max_date
and ped_1.employee_code = 'GSSH0039'
);
pit_key not in (...)
pit_key
d v>_date
pit_key not in (...)
, field inconsistency causes error.
3. Solutions
Make changes for different reasons.
Read More:
- Mysql reports an error Operand should contain 1 column(s)
- MySQL error 1054 (42s22) unknown column ‘password’ in ‘field list’
- MySQL ERROR 1054 (42S22): Unknown column’password’ in’field list’ error
- MySQL password setting error message: error 1054 (42s22): unknown column ‘password’ in ‘field list’
- MySQL – ERROR 1146 (42S02): Table ‘mysql.user’ doesn’t exist
- MySQL error: column ‘ID’ in field list is ambiguous
- How to Fix SQL Error: 1054, SQLState: 42S22 Unknown column ‘markcardex0_.art_service_time’ in ‘field list’
- Error 1136 (21s01): column count doesn’t match value count at row 1
- MySQL unknown column ‘in’ field list ‘solution
- Get connection timeout retry: 1 MySQL errorcode 0, state 08s01 docker container accessing MySQL container is very slow and sometimes interrupted
- MySQL operation and maintenance slave_ skip_ errors
- mysql ERROR 1050 (42S01): Table already exists
- Word column after the text evenly distributed in the left and right two columns, rather than fill in the left column and then fill in the right column, how to do?
- [MySQL] error 1396 (HY000): Operation create user failed for ‘MySQL’ @’localhost ‘
- In the SQL query statement, add the column that does not exist in the table and set the fixed value of the column
- Linux-mysql8.0 password reset problem – error 1396 (HY000): Operation alter user failed for ‘root’ @’localhost ‘
- The image operation of MATLAB — every detail operation of colorbar
- MySQL error: InnoDB: operating system error number 13 in a file operation
- SQL error: 17006, sqlstate: 99999 invalid column name
- Solution to “550 create directory operation failed” in FTP operation file