As for the subqueries, use a temp table. As to stored procedures, write a client side equiv, or a command line event on the server. It depends on what you are trying to acheive as to the type of answer you will get.
are you using mysql 4.0 or 4.1? 4.1 does support subqueries. Also note that subqueries are not necessary as all queries using subqueries can be re-written as joins.
I looked at the example you provided, and it really is a poor design for a customer tracking system.
Instead of spending the time to fix the current system, invest the time in creating a new system.
The mutiple tables that you are using are not a good design, and as another person pointed out, they will cause you grief as the system tables increase, or if you have muplitple packages to a single person.
To get the reporting you need, you would not need sub-queries in a properly desinged database, and any future mods would be easier to implement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.