Advertisement

08.05.2008 at 12:50PM PDT, ID: 23623615
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Count multiple tables and join them by date.

Asked by Azurewave in MySQL Server

Tags:

Hey there well I have two tables that I would like to join together, I don't know if JOIN is the proper function either.

Anyway here goes:

This table holds the actual sales per site, customid is the id that made the sale, each one of these results return 1 sale, and it tells which id made the sale.  In here there are two sales for customid 8, and they were both on the same date.

table1 {
  id
  date
  customid
}
insert into table1 (id, date, customid) VALUES('1', '2008-04-08', '8')
insert into table1 (id, date, customid) VALUES('2', '2008-04-08', '8')

this table has information about the customid that made the sale, the title for example of the customid, currently only customid 8 has made a sale.
table2 {
  customid
  title
}
insert into table1 (customid, title) VALUES('8', 'Jim Rocks');
insert into table1 (customid, title) VALUES('2', 'Mike Solomon');

this table holds the statistical data for the sales, from the insert data, If i filter by 2008-04-08, i get four results, i need to be able to get the sum of "hits" and "joinhits" for that particular customid.
table3 {
  date
  hits
  joinhits
  customid
}
insert into table1 (date, hits, joinhits, customid) VALUES( '2008-04-07', '58', '433', '8')
insert into table1 (date, hits, joinhits, customid)) VALUES('2007-05-08', '58', '433', '8')
insert into table1 (date, hits, joinhits, customid)) VALUES('2008-04-08', '58', '433', '8')
insert into table1 (date, hits, joinhits, customid)) VALUES('2008-04-08', '58', '433', '8')
insert into table1 (date, hits, joinhits, customid)) VALUES('2008-04-08', '30', '433', '8')
insert into table1 (date, hits, joinhits, customid)) VALUES('2008-04-08, '58', '433'', '8')

If i were to run the query this is the results I should get.

Thank you, you have searched for 2008-04-07
Title                       Hits    Joinhits
Jim Rocks           204           1612

I would also like to do date ranges.Start Free Trial
[+][-]08.05.2008 at 01:33PM PDT, ID: 22164915

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 02:24PM PDT, ID: 22165315

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 02:30PM PDT, ID: 22165351

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 02:58PM PDT, ID: 22165547

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 03:20PM PDT, ID: 22165652

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL Server
Tags: MySQL
Sign Up Now!
Solution Provided By: psadac
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.05.2008 at 03:50PM PDT, ID: 22165798

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628