firebird - SQL subquery or not? -


i trying find query select 2 tables not join 2 tables don't want result on 1 line.

lets have these tables:

persons1                 persons2 number name    surname   number  name   surname -----------------------  -------------------------  1      peter   miller    1       frank  farian  2      hans    geige     2       thomas müller 

and when use query:

select   new.name,   old.name   persons1 new,   persons2 old   new.number = 1 ,   old.number = 1 

i following result:

peter   frank 

how write query get:

peter frank 

use union this:

select new.name persons1 new new.number = 1 union  select old.name persons2 old old.number = 1 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -