0
I have a column that is numerical. In this column there are positive and negative values. I need to make an appointment that when I’m positive, I’ll consult Tabela A
, when negative I refer to Tabela B
. I have no idea how to do that?
0
I have a column that is numerical. In this column there are positive and negative values. I need to make an appointment that when I’m positive, I’ll consult Tabela A
, when negative I refer to Tabela B
. I have no idea how to do that?
0
A possible solution is :
Create a view that brings the two together
tables
create or replace view v_view as
select cod,nome
from tabela1
union
select cod,nome
from tabela2
Do the Join in the view
select *
from tabela3,v_view
where v_view.cod = tabela3.cod
Browser other questions tagged java sql postgresql query
You are not signed in. Login or sign up in order to post.
both in the past and in the java you can make a
if
to validate.– Marconi
I consulted and used LEFT JOIN and then use an if to check the value of the column and get the value that interests me, vlw
– HimorriveL
Vote today! Vote tomorrow! Vote forever! Vote consciously! Your vote is very important to our community, contribute to us, and help make Stack Overflow in Portuguese (Sopt) bigger and bigger. You can learn more at: Vote early, vote often
– Marcos Henzel