mysql - SQL, Recursive Query -


can please me query working selecting data's tables wanted display fields connected other fields using recursive query.

my table

enter image description here

i have self query does'nt output connected , connected fibers query

select closure_id, fiber_id , @pv:=fiber_id 'fiber_id2'       (select * tbl_map_closure_fiber order closure_id) join     (select @pv:=1)tmp  closure_id=@pv 

enter image description here

just askin how can manage ouput both connected closure_id , connected fiber. please 1 .

you need join table pair related rows.

select t1.fiber_id, t2.fiber_id fiber_id2 tbl_map_closure_fiber t1 join tbl_map_closure_fiber t2 on t1.fiber_id = t2.closure_id 

http://sqlfiddle.com/#!9/3f83ee/2


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -