i having trouble in writing sql query php query, (for premiere product database). have total number of orders placed customer given customer number.
select customername, firstname, lastname, count(distinct(customernum)) customer, orders, rep customer.customernum=orders.customernum andcustomer.repnum=rep.repnum , customer.customernum=customernum;
the code above gives me error message "#1052 - column 'customernum' in field list ambiguous".
this means 2 or more of tables concerned in query have field called customernum
, doesn't know you're referring to. prefix table name.
count(distinct(your_table_name.customernum))
Comments
Post a Comment