Hello All,
I am having a table orders
orders (
id int unsigned not null,
fcr_date TIMESTAMP,
completion_date TIMESTAMP,
factory_no varchar(255),
vendor_no varchar(255))
Please ignore the data type typos if any.
I want to write a sql query that helps me fetch the data per vendor factory. The data to fetch includes the number of orders per vendor factory(a unique group of vendor_no, factory_no), vendor_no, factory_no and the number of orders for which fcr_date is greater than completion_date.
I am new to sql and this particular query seems quite complex to me. I would appreciate if some one could guide me thro on how to write this query.
Thanks.