mysql - select the extra row data -
this table sample, had deleted lot column.
id orid to_id seq 1 1 5 a12 2 2 6 a12 3 3 7 a12 4 4 _ a12 <--- want find row 5 5 _ a13 6 6 _ a13 7 7 _ a13
i want find data. want use 2 sql find data.
(select * forgerock seq = 'a13') (select * forgerock seq != 'a13') b
i had tried it, not wanted. how can it? thanks.
select b.* (select * forgerock seq = 'a13') right join (select * forgerock seq != 'a13') b on a.to_id = b.to_id;
this sqlfiddle
i guessing want find rows have no connection row.
select fr.* forgerock fr fr.to_id null , not exists (select 1 forgerock fr2 fr.from_id = fr2.to_id );
Comments
Post a Comment