Hi all,
I used the 1st query into 2nd one when counting the commission as following:
1. SELECT DISTINCT tblCustomer.Name, tblCustomer.JobType, tblSale.Unit, tblSale.Price FROM tblCustomer, tblSale WHERE tblCustomer.id = tblSale.customerid; 2. SELECT b.Name, (CASE WHEN b.JobType = "FULL TIME" THEN ((b.Unit * b.Price) * 0.25) WHEN b.JobType = "PART TIME" THEN ((b.Unit * b.Price) * 0.15) END) AS b.Commission FROM (SELECT DISTINCT tblCustomer.Name, tblCustomer.JobType, tblSale.Unit, tblSale.Price FROM tblCustomer, tblSale WHERE tblCustomer.id = tblSale.customerid) b );
I use the COUNT(*) for both above queries, there are more records on 2nd query. My expectation are produced same records for both queries. Do you know why and how to correct the syntax on them. Thanks.