Answer the question
In order to leave comments, you need to log in
How to check 2 sql queries for full match?
There are 2 requests. One is known initially (the answer to the task), and the second comes from the frontend. It is necessary to check for a FULL match of the query results. Answers of the form: well, dig in the direction of EXCEPT / INTERSECT are not interested. Copal. A query like SELECT id_connection FROM tasks EXCEPT SELECT id FROM tasks doesn't throw any errors and runs smoothly. Maybe someone already has a ready request?
Answer the question
In order to leave comments, you need to log in
As I understand it, you would like the column names and types to be exactly the same?
As far as I understand, there is no portable way to do this, so the easiest way is
1). Get column names from both queries. Compare.
2) Get column types from both queries. Compare.
3). And now after that - EXCEPT.
All this in a way specific to your database.
If everything matches, the requests are identical.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question