Hi, i am creating the following view and I was wondering if this is a correct query to have? the query works just fine but i am not sure if it is tune the best way.
Basically i have 4 inner join and one left outer join because i need to show the data when applies in the tableextra. As I said, the query works fine but I need to know if this is a proper query for the view I am creating. Any thoughts will be greatly appreciate it thanks.
select
one.uniqueID as uniqueID,
one.unique_id as unique_id,
rtrim(two.Name) as Name,
rtrim(three.Phone) as Phone,
rtrim(four.de) as de,
rtrim(four.me) as me,
rtrim(five.valss) as valss,
rtrim(five.sss) as sss,
rtrim(five.ppp) as ppp,
rtrim(five.ooo) as ooo,
rtrim(extra.per) as per,
rtrim(extra.loc) as loc,
rtrim(extra.ssc) as ssc,
from
tJPayMailLetters one
inner join tabletwo two on one.unique_id = two.ID
inner join tablethree three on one.b_id = three.ID
inner join tablefour four on one.c_id = four.ID
inner join tablefive five on one.d_id = five.unique_id
left outer join tableextra extra on five.e_id = extra.e_id
Basically i have 4 inner join and one left outer join because i need to show the data when applies in the tableextra. As I said, the query works fine but I need to know if this is a proper query for the view I am creating. Any thoughts will be greatly appreciate it thanks.
select
one.uniqueID as uniqueID,
one.unique_id as unique_id,
rtrim(two.Name) as Name,
rtrim(three.Phone) as Phone,
rtrim(four.de) as de,
rtrim(four.me) as me,
rtrim(five.valss) as valss,
rtrim(five.sss) as sss,
rtrim(five.ppp) as ppp,
rtrim(five.ooo) as ooo,
rtrim(extra.per) as per,
rtrim(extra.loc) as loc,
rtrim(extra.ssc) as ssc,
from
tJPayMailLetters one
inner join tabletwo two on one.unique_id = two.ID
inner join tablethree three on one.b_id = three.ID
inner join tablefour four on one.c_id = four.ID
inner join tablefive five on one.d_id = five.unique_id
left outer join tableextra extra on five.e_id = extra.e_id