Report: SQLSTATE[21000]: Cardinality cheesecake: 1242 Subquery returns more than 1 row
error means that the sub-query results are less than one row. The error is as follows:
error means that the sub-query results are less than one row. The error is as follows:
Select * from table1 where table1. Colums =(select columns from table2); Take this SQL statement as an example.
1) if you are writing duplicates, remove the duplicates. When writing, you can add a logical decision (PHP) or a foreign key (mysql) to prevent the data from being written repeatedly.
(in my actual development, I encountered the situation of repeatedly writing data, I found the same two data in the database, which is not consistent with the original business requirements)
2) add limit 1 in the sub-query condition statement, find a qualified one can be
select * from table1 where table1. Colums =(select columns from table2 limit 1);
Read More:
- Error: more than one row returned by a subquery used as an expression
- MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key co
- Mysql error 1452 – Cannot add or update a child row: a foreign key constraint fails
- MYSQL ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
- mysql5.7.26:[ERR] 1118 – Row size too large (> 8126)
- Solution to error 1452: cannot add or update a child row: a foreign key constraint failures in MySQL
- Mysql error when deleting the table structure: Error Code: 1217. Cannot delete or update a parent row: a foreign key constraint fails
- MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- Global lock, table lock and row lock in MySQL
- Top35: pychar reports an error when connecting to MySQL server returns invalid timezone. Need to set ‘servertimezone’ property
- where in subquery source [How to Solve]
- Matlab delete row or col to delete the row or column of the matrix
- How to Solve mybatis returns null when querying Oracle database with char type field
- The togglerowexpansion method of the table of element UI expands the specified row
- Macfee can not be upgraded, the prompt returns an error
- MySQL – ERROR 1146 (42S02): Table ‘mysql.user’ doesn’t exist
- RegOpenKeyEx returns error value 5
- VBA returns “n / a” and other error information
- Error 1136 (21s01): column count doesn’t match value count at row 1
- Python TCP socket programming: send returns broken pipe error?