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
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
FYI version 1.4.200 seems to support this now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With