Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: check if the results of two query are the same or not

Re: check if the results of two query are the same or not

From: slim <sfar_selim_at_excite.com>
Date: 23 May 2002 08:07:47 -0700
Message-ID: <491f65ba.0205230707.4c00bf74@posting.google.com>


"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:<1022143464.25395.0.nnrp-01.9e984b29_at_news.demon.co.uk>...
> various options but pure sql solution would be:
>
> select * from
> (
> (q1 minus q2) -- all rows from q1 not in q2
> union all
> (q2 minus q1) -- all rows from q2 not in q1
> )

  thanks for you, I have yet tried this solution but suppose that q1 return for example 3 rows :

     col_value
     ---------
             7
             7
             6
and q2 return also 3 rows :
     col_value
     ---------
             7
             6
             6

Your query should not returns rows but the result of q1 and q2 are not the same        

>
> If you get any rows, then the queries are not the same.
>
>
> --
> Jonathan Lewis
> http://www.jlcomp.demon.co.uk
>
> Author of:
> Practical Oracle 8i: Building Efficient Databases
>
> Next Seminar - Australia - July/August
> http://www.jlcomp.demon.co.uk/seminar.html
>
> Host to The Co-Operative Oracle Users' FAQ
> http://www.jlcomp.demon.co.uk/faq/ind_faq.html
>
>
>
> slim wrote in message <491f65ba.0205230026.4760a4b2_at_posting.google.com>...
> >Hi,
> >How can I check that the results of two query (q1 and q2) are exactly the
> same
> > thank you
Received on Thu May 23 2002 - 10:07:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US