add remove split language chart show hidden hide
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version()
8.0.36
Records: 2  Duplicates: 0  Warnings: 0
query
select 'fiddle.selling' where exists (select null from fiddle.selling where cur_id = @id)
union all
select 'fiddle.buying' where exists (select null from fiddle.buying where id_currency = @id)
fiddle.selling
fiddle.selling
fiddle.buying