Hello i work on one project using JS, PHP & Mysql. I have 2 tables which are :
invoice (inv_id,date,total,paid,due)
invoice_infos (id, product_name,product_price,inv_id)
invoice_infos contains informations about all products of a invoice.
The column date of table invoice contains the date of the invoice, the column product_name of invoice_details contains name of product.
I want do a query which allow me view product selled in defined date.
You seem to be looking for a simple
JOINbetween both tables, using fieldinv_id. TheFROMclause of your queries should look like :Starting from there, say you want to pull out all available information in
invoice_infosandinvoicesfor a specific date of sale :Another typical use case is to aggregate date. For example let's compute the total price for each product sold on a given date :