Tuesday, 15 September 2015

sql - How can I order by two same attributes from differents tables? -



sql - How can I order by two same attributes from differents tables? -

i've got db. starters, didn't created db , can't alter structure, have deal it.

+------+ +--------+ +--------+ | form | | form_a | | form_b | +------+ +--------+ +--------+ | id | | form_id| | form_id| | name | | name |

i'm not oracle user, need form form_a datas form_b, need order name both tables. "name" same kind of datas form_a , form_b, bad it's not in form.

exemple : form_a = [a, b, d, f] form_b = [e, c, g] form datas must ordered form_a(a), form_a(b), form_b(c), form_a(d), form_b(e)...

at first think i'll have order manually loops, wonder if there way order multiples tables together, , not 1 after other ?

you can

select * ( select id, null name form union select id, name forma union select id, name formb ) temp order temp.name

sql oracle

No comments:

Post a Comment