Oracle

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesOracle

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old February 13th, 2014, 11:49 PM
tanthiamhuat tanthiamhuat is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Feb 2014
Posts: 1 tanthiamhuat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 54 sec
Reputation Power: 0
How to loop through a query using LINQPAD?

I have this query in LINQPAD which query a Oracle database:

SELECT TIME_TEST+TIME_STEP AS Productive_Time
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('18/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

However, I need to extract out the SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime on a daily basis, and thus I need to execute those below codes each time to extract out each day values. How do I combine those into 1 single query such that each day data can be displayed? Do I need to write a loop inside the WHERE condition?

SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('13/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('14/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('14/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('15/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('15/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('16/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('16/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('17/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

SELECT SUM(TIME_TEST+TIME_STEP) as ProductiveTime
FROM PFODS.PPL_TESTSYSTEMS_UTILISATION
WHERE (SYSTEMTYPE = '0005-064') AND
(TS_START >= to_date('17/01/2014', 'DD/MM/YYYY'))
AND (TS_End <= to_date('18/01/2014 00:1:59', 'DD/MM/YYYY HH24:MI:SS')) AND MONO != '9999999999'
Order by TS_START ASC

In addition to display the SUM(TIME_TEST+TIME_STEP) for each day, I also need to display the date itself.

I do no want (cannot) to write anything on Stored Procedure, and I can only write simple query.

thanks.

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesOracle > How to loop through a query using LINQPAD?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap