Login

Contact Us
Programming
Programming Questions? Ask a Programmer for Answers ASAP
Not a Programming Question?
How JustAnswer Works:
Ask an Expert
Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
Get a Professional Answer
Via email, text message, or notification as you wait on our site.
Ask follow up questions if you need to.
100% Satisfaction Guarantee
Rate the answer you receive.
Ask LeelaTheProgrammer Your Own Question
LeelaTheProgrammer
,
Computer Software Engineer
Category:
Programming
Satisfied Customers:
474
Experience:
Post Grad in CS (Gold Medal)
21067471
Type Your Programming Question Here...
LeelaTheProgrammer is online now
I'm trying to find a way to ensure that my pivot table always
Customer Question
I'm trying to find a way to ensure that my pivot table always has seven columns and 48 rows of data even if the following query doesn't return actual values. I need this so that the daily and interval data is always in the same place. My SQL query is to large to include the entire query. I'd be happy to email it to you.
Select
DATENAME(DW,tl.DTE) AS DOW,
*,
case when tl.START_TIME '00:00:00' then 1 else 0 end as 'INT_HR_00:00',
case when tl.START_TIME '00:30:00' then 1 else 0 end as 'INT_HR_00:30',
case when tl.START_TIME '01:00:00' then 1 else 0 end as 'INT_HR_01:00',
case when tl.START_TIME '01:30:00' then 1 else 0 end as 'INT_HR_01:30',
case when tl.START_TIME '02:00:00' then 1 else 0 end as 'INT_HR_02:00',
case when tl.START_TIME '02:30:00' then 1 else 0 end as 'INT_HR_02:30',
case when tl.START_TIME '03:00:00' then 1 else 0 end as 'INT_HR_03:00',
case when tl.START_TIME '03:30:00' then 1 else 0 end as 'INT_HR_03:30',
case when tl.START_TIME '04:00:00' then 1 else 0 end as 'INT_HR_04:00',
case when tl.START_TIME '04:30:00' then 1 else 0 end as 'INT_HR_04:30',
case when tl.START_TIME '05:00:00' then 1 else 0 end as 'INT_HR_05:00',
case when tl.START_TIME '05:30:00' then 1 else 0 end as 'INT_HR_05:30',
case when tl.START_TIME '06:00:00' then 1 else 0 end as 'INT_HR_06:00',
case when tl.START_TIME '06:30:00' then 1 else 0 end as 'INT_HR_06:30',
case when tl.START_TIME '07:00:00' then 1 else 0 end as 'INT_HR_07:00',
case when tl.START_TIME '07:30:00' then 1 else 0 end as 'INT_HR_07:30',
case when tl.START_TIME '08:00:00' then 1 else 0 end as 'INT_HR_08:00',
case when tl.START_TIME '08:30:00' then 1 else 0 end as 'INT_HR_08:30',
case when tl.START_TIME '09:00:00' then 1 else 0 end as 'INT_HR_09:00',
case when tl.START_TIME '09:30:00' then 1 else 0 end as 'INT_HR_09:30',
case when tl.START_TIME '10:00:00' then 1 else 0 end as 'INT_HR_10:00',
case when tl.START_TIME '10:30:00' then 1 else 0 end as 'INT_HR_10:30',
case when tl.START_TIME '11:00:00' then 1 else 0 end as 'INT_HR_11:00',
case when tl.START_TIME '11:30:00' then 1 else 0 end as 'INT_HR_11:30',
case when tl.START_TIME '12:00:00' then 1 else 0 end as 'INT_HR_12:00',
case when tl.START_TIME '12:30:00' then 1 else 0 end as 'INT_HR_12:30',
case when tl.START_TIME '13:00:00' then 1 else 0 end as 'INT_HR_13:00',
case when tl.START_TIME '13:30:00' then 1 else 0 end as 'INT_HR_13:30',
case when tl.START_TIME '14:00:00' then 1 else 0 end as 'INT_HR_14:00',
case when tl.START_TIME '14:30:00' then 1 else 0 end as 'INT_HR_14:30',
case when tl.START_TIME '15:00:00' then 1 else 0 end as 'INT_HR_15:00',
case when tl.START_TIME '15:30:00' then 1 else 0 end as 'INT_HR_15:30',
case when tl.START_TIME '16:00:00' then 1 else 0 end as 'INT_HR_16:00',
case when tl.START_TIME '16:30:00' then 1 else 0 end as 'INT_HR_16:30',
case when tl.START_TIME '17:00:00' then 1 else 0 end as 'INT_HR_17:00',
case when tl.START_TIME '17:30:00' then 1 else 0 end as 'INT_HR_17:30',
case when tl.START_TIME '18:00:00' then 1 else 0 end as 'INT_HR_18:00',
case when tl.START_TIME '18:30:00' then 1 else 0 end as 'INT_HR_18:30',
case when tl.START_TIME '19:00:00' then 1 else 0 end as 'INT_HR_19:00',
case when tl.START_TIME '19:30:00' then 1 else 0 end as 'INT_HR_19:30',
case when tl.START_TIME '20:00:00' then 1 else 0 end as 'INT_HR_20:00',
case when tl.START_TIME '20:30:00' then 1 else 0 end as 'INT_HR_20:30',
Submitted:
7 months ago.
Category:
Programming
Share this conversation
Expert:
LeelaTheProgrammer
replied 7 months ago.
Hi,
Thanks for using justanswer. This is Leela and I will help you with the question today.As per my understanding your are trying to find a way to check that a table has specific number of columns and rows in MySql.This can accomplished in multiple ways.1) query meta data of table to find column count, run sql query to count row count.
2) run a select * from table query, check column count and row count from results of the query.Hope this helps.Please let me know if you have any further queries.All the best.Leela
Ask Your Own Programming Question
Share this conversation
Related Programming Questions
Question
Date Submitted
I needed assistance with this homogeneous array with 8 rows
12/5/2016
12/5/2016
LogicPro
Use LogicPro Only: The Rnrbooks.mdf database file holds two
12/4/2016
12/5/2016
LogicPro
What is the best path for learning how to create programs to
12/3/2016
12/3/2016
LogicPro
I have one more assignment, this one I only need help with
12/3/2016
12/6/2016
George Sibiya
What do you know about keystroke macros in MS Word? Windows
12/2/2016
12/3/2016
Michael Hannigan
OKPR121211 What programming languages should I learn, or
12/2/2016
12/2/2016
Russell H.
Raptor: Sales Report Brewster’s Used Cars, Inc. employs
11/30/2016
11/30/2016
LogicPro
To Sibiya: I get error "Access Violation writing location
11/29/2016
12/5/2016
George Sibiya
It's for Excel 2010  pretty simple need for a macro, Excel
11/24/2016
11/24/2016
Richard
I am working with Microsoft Excel 2013 for PC and using a
11/24/2016
11/24/2016
Richard
X
Ask a Programmer
Get a Professional Answer. 100% Satisfaction Guaranteed.
21 Programmers are Online Now
Type Your Programming Question Here...
characters left: