depuration table with gorm

0

People, I'm having a debugging problem.

I'm working with GORM, and I have to debug a table with more than 20,000,000 records.

I have to debug records depending on a particular date, the idea is to have the database engine bank, for which I would be doing:

Table1.executeQuery ("delete table1 where ....

The problem that I have a table2 that has as its primary key an id from table1.

This should be done in batches of rows to be deleted, by console in sql server the query would be the following. delete table2 where table1_id in ( select ID from table1 top = 1000 where datevalue < to_date ('31 -JUL-18 ',' DD-MON-YY ') );

This would eliminate 1000 records from table2 when it has matches from table id1.

I do not know how to translate it to GORM to do the same ...

    
asked by wagego 12.12.2018 в 17:19
source

0 answers