开发者

Sql Queries for finding the sales trend

Suppose ,I have a table which has all the billing reco开发者_如何学Crds. Now I want to see the sales trend for a user given time duration group by each 3 days ...what should be the sql query regarding this?

please help,Otherwise I am gone ...


I can only give a vague suggestion as per the question, however you may want to have a derived column with a standardised date (as per MS date format, just a number per day) that you could then use a modulus (3) on so that days are equal per 3 day period. You can then group and aggregate over this column to get the values for a 3 day period. Obviously to display the date nicely you would have to multiply back and convert your column as well.

Again I'm not sure of the specifics, but I think this general idea could be achieved to get a result (may well not be the best way so it would help to add more to the question...)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜