var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Get MIN ROW from two tables
I have two tables 'table1' and 'table2' which have a common column column as master child relationship.
Please suggest query that joins these tables but returns only min(idx) from the 'table2' for each cust_id (one row each).
select t1.cust_id, idx = min(t2.idx)
from Table1 t1
join Table2 t2
on t1.cust_id = t2.cust_id
group by t1.cust_id
If some don't have children then just change join to left outer join