var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Join question.
Please excuse my SQL ignorance here.
I have 2 tables that I need to query:
I know that this scenario is probably better handled with 3 tables but I still like to figure it out with the current scheme.
I've used inner joins in the past to pull from both tables, but I'm not exactly sure how to get tablea.id and the tableb.name from both tableb_id_1 AND b_id_2 using 1 query.
Thanks in advance for your help.
use inner joins if you are positive that both foreign keys are valid
, one.name as name1
, two.name as name2
join Tableb as one
on Tablea.tableb_id_1 = one.id
join Tableb as two
on Tablea.tableb_id_2 = two.id
Thanks for your help. It totally skipped my mind that I could use AS in the JOIN block.