问题
I have 2 kinds of software (both Java): One with MySSQL and the other with H2 database. My problem is that in MySQL I have this query:
Select * from X where (1,2,3) in (select 4,5,6 from Y)
But in H2 throw me this error:
Subquery is not a single column query; SQL statement:
I understand basically what this mean but I need to select all values from X that are in Y and I read that this is the most efficient way. The other way could be asign all the values from Y to a Java Object and then put them in to X but I know that this is not the "best" way to do it
回答1:
Try to modify the query to have single values
Select * from X where CONCAT(1,2,3) in (select CONCAT(4,5,6) from Y)
So instead of 3 columns you have one where all the 3 column values are joined
来源:https://stackoverflow.com/questions/46056328/where-in-select-h2