Advertisement

03.14.2008 at 07:30AM PDT, ID: 23241790
[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!

6.9

How to combine these two select statements?

Asked by krugar77 in MySQL Server

Tags: ,

select *
from tbl_a, tbl_b
where floor(tbl_b.engaged_time) = tbl_a.time_in_sec and tbl_b.set_id = tbl_a.run_id

select *
from tbl_a, tbl_b
where ceiling(tbl_b.engaged_time) = tbl_a.time_in_sec and tbl_b.set_id = tbl_a.run_id


Essentially what I am trying to do is take the event data that occurs at the floor and the ceiling time and generate a single recordset from that based on the engaged time to determine the floor and ceiling.

tbl_a contains event data by whole time rounded to the second
tbl_b contains the real time not rounded timestamp but does not include any event data

tbl_a example:
id, time_in_sec, x, y, z, run_id
1, 95, 45, 32, 8, set_a
2, 96, 45, 33, 8, set_a
3, 97, 46, 33, 8, set_a
4, 98, 46, 34, 7, set_a
5, 99, 47, 35, 8, set_a
6, 100, 40, 32, 8, set_a
7, 101, 41, 33, 8, set_a
8, 115, 42, 32, 9, set_a
9, 116, 43, 34, 8, set_a
10, 68, 60, 50, 7, set_b
11, 69, 61, 51, 7, set_b
12, 99, 63, 53, 7, set_b
13, 100, 64, 53, 7, set_b
14, 101, 64, 52, 7, set_b
15, 102, 65, 53, 8, set_b
16, 103, 66, 54, 7, set_b
17, 125, 62, 52, 7, set_b
18, 126, 62, 53, 8, set_b

tbl1_b example:
id, engaged_time, set_id
1, 100.123, set_a
2, 115.234, set_a
3, 95.345, set_a
4, 68.454, set_b
5, 125.657, set_b
6, 99.867, set_b

Ideal output:
100.123, 100, 40, 32, 8, 101, 41, 33, 8, set_a
115.234, 115, 42, 32, 9, 116, 43, 34, 8, set_a
95.345, 95, 45, 32, 8, 96, 45, 33, 8, set_a
68.454, 68, 60, 50, 7, 69, 61, 51, 7, set_b
125.657, 125, 62, 52, 7, 126, 62, 53, 8, set_b
99.867, 99, 63, 53, 7, 100, 64, 53, 7, set_b

Thank you in advance. If more clarification is required please let me know.
Start Free Trial
 
Loading Advertisement...
 
[+][-]03.14.2008 at 07:36AM PDT, ID: 21125889

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 07:57AM PDT, ID: 21126111

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 08:12AM PDT, ID: 21126256

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 08:23AM PDT, ID: 21126374

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2008 at 08:30AM PDT, ID: 21126423

View this solution now by starting your 7-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, 5.0.14
Sign Up Now!
Solution Provided By: _iskywalker_
Participating Experts: 2
Solution Grade: B
 
 
[+][-]03.14.2008 at 10:03AM PDT, ID: 21127227

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628