用日期明智地计数SQL中的记录 [英] count record in sql with date wise
问题描述
我有两个桌子
1. production_main 2. trackwork_pd
在第一个表中,我维护条形码,品牌,性别信息,在第二个表中,我维护(条形码,productindt和productoutdt).
因此,我想要一个SQL查询,其中用户提供当前日期,并与productindt列进行比较,并按日期对记录进行查询计数,并以类型格式显示并显示产品的品牌和性别.
品牌性别总条形码
艾迪亚斯男29岁
但是我无法进行这种类型的查询,而用户只能输入日期并在查询告诉用户使用哪种品牌和性别的产品总数时显示这种记录.
谢谢
这里是一个提示
SELECT [columns], COUNT(column) FROM table JOIN table1 ON table.column = table2.column WHERE date = @date_provided
hi
i have two table
1. production_main 2. trackwork_pd
In first table i have maintain barcode, brand, gender information and in second table i have maintain (barcode, productindt and productoutdt).
So i want a sql query where user give current date and i compare with productindt column and query count the record by datewise and display that is type format and show which brand and which gender total product in.
brand gender totalbarcode
addias male 29
but i not able to make that type of query where user only input date and display this type of record where query tell the user to which brand and which gender total product in.
thanks
Here''s a hint
SELECT [columns], COUNT(column) FROM table JOIN table1 ON table.column = table2.column WHERE date = @date_provided
这篇关于用日期明智地计数SQL中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!