A simple inner join
select * from table1 a
inner join
dbo.table2 b
on a.inventory_id = b.inventory_id
Wouldn’t it be nice and intuitive to put it like this?
select * from table1 a
inner join
dbo.table2 b
on inventory_id
Are there any comparable succinct approaches?
Thanks!
How about a natural join:
However, your RDBMS may not support it, and I would recommend always specifying the join type and conditions in your queries. It’s much more maintainable in the long run.
I’m guessing from the
dbo.that you’re using SQL Server though, and it’s not supported there. See here for more info.Edit:
There’s another possibility that’s again not supported by SQL Server but is worth noting. This could actually be worth using, as your join condition is clearly specified. More info here.