Hi guys, I have been work on a migration and I will use a subquery to do that but I get this error, let me show some examples for you understand better :
SELECT * FROM TEST WHERE ROWNUM IS DISTINCT FROM (SELECT min(ROWNUM) FROM TEST GROUP BY NAME); SELECT * FROM TEST WHERE ROWNUM NOT IN (SELECT ID FROM TEST LIMIT 2); you can create a table to test with this script DROP TABLE IF EXISTS TEST; CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255)); INSERT INTO TEST VALUES(1, 'Hello'); INSERT INTO TEST VALUES(2, 'Hello'); INSERT INTO TEST VALUES(3, 'Hello'); INSERT INTO TEST VALUES(4, 'bye'); INSERT INTO TEST VALUES(5, 'bye'); INSERT INTO TEST VALUES(6, 'bye'); Can someone help me to resolve this problem or help me to do a workaround for my problem? in really I need to do an update on that table, I tried to use that: UPDATE TEST SET NAME ='teste' WHERE ROWNUM NOT IN (SELECT* FROM TEST GROUP BY NAME ); but NOT IN doesn't work at all. []'s Regards All help's welcome. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
