ms access - sql using Count(*) function -


i using microsoft access 2013 , i'm trying find number of orders in each cafe number shown wrong. code:

select avg(feedback.ratingforexperience) caferating,       count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product, feedback group feedback.cafeid; 

please me, thank you.

enter image description here screen1

[]

as mentioned in comments, need join tables together. below sql.

select avg(feedback.ratingforexperience) caferating,   count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product inner join feedback on tblorder_product.ordercode = feedback.ordercode group feedback.cafeid; 

or

select avg(feedback.ratingforexperience) caferating,   count(tblorder_product.productcode) cafesales, feedback.cafeid tblorder_product left join feedback on tblorder_product.ordercode = feedback.ordercode group feedback.cafeid; 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -