y this query answer wrong ?
-
(SORRY FOR MY BAD ENGLISH ) i have these : cust_line (line_num,cust_id). line_contact(contact_period,line_num). i want to know the customer who the customer of the longest period contact i think this is the quest select max(cc),cust_line.line_num from cust_line JOIN ( select SUM(contact_period)as cc , line_num from line_contact group by line_num )As a on cust_line.line_num=a.line_num where cust_line.line_num=A.line_num but it make a wrong results , please help me ty
-
(SORRY FOR MY BAD ENGLISH ) i have these : cust_line (line_num,cust_id). line_contact(contact_period,line_num). i want to know the customer who the customer of the longest period contact i think this is the quest select max(cc),cust_line.line_num from cust_line JOIN ( select SUM(contact_period)as cc , line_num from line_contact group by line_num )As a on cust_line.line_num=a.line_num where cust_line.line_num=A.line_num but it make a wrong results , please help me ty
hi hope below query will work for you,
select cust_id,max(contact_period) from line_contact,cust_line where line_contact.line_num = cust_line.line_num;
thanks -amit
-
(SORRY FOR MY BAD ENGLISH ) i have these : cust_line (line_num,cust_id). line_contact(contact_period,line_num). i want to know the customer who the customer of the longest period contact i think this is the quest select max(cc),cust_line.line_num from cust_line JOIN ( select SUM(contact_period)as cc , line_num from line_contact group by line_num )As a on cust_line.line_num=a.line_num where cust_line.line_num=A.line_num but it make a wrong results , please help me ty