Our approach [with RAGS] is to execute the same query on multiple vendor's DBMSs and then compare the results. First, the number of rows returned is compared, and then, to avoid sorts, a special checksum over all the column values in all the rows is compared. The comparison model only works for SQL statements that will execute on more than one vendor's database, such as entry level ANSI 92 compliant SQL [ref].
Google-1
Google-2
By permission of the Very Large Database Endowment