stanley1610 Posted September 19, 2007 Share Posted September 19, 2007 I have a table in this format: Name: VarcharFood: VarcharDate: Date There's no primary key.e.g. Sam eats icecream on 19 Sep 2007, then the record will storeSam, icecream, 19 Sep 2007. If the case:Sam, icecream, 19 Sep 2007.Susan, icecream, 20 Sep 2007.Jacky, icecream, 21 Sep 2007. Then Susan and Jacky did "repeat eat" because Susan and Jacky repeat the same food "icecream" as Sam within 14 days. My report (in JasperReports) will draw how many repeat eat there is. The result will look like: Report A -FOOD, NUMBER OF REPEATicecream, 2orange, 3 Report B -NAME, FOOD NUMBER OF REPEATSam, biscuit, 1Sam, orange, 1Susan, biscuit, 1 The most critical challenge is the number of records in the table around 20,000. If combining them directly, it will be around 400,000,000 records in immediate table. How can I do the reports? Many thanks. Link to comment Share on other sites More sharing options...
csbac Posted September 19, 2007 Share Posted September 19, 2007 Hi!Use GROUP BY in the SQL clause(s), I'd say ...Sebastian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now