Calendar of the apex; limit values for each day/cell
Apex 4.2
I'm working on a calendar widget to my page. The calendar will be specific sectors (using the abbreviation of sector space maximze) for each day. When you use the calendar, I noticed the sectors more you have, the cell for this day will begin to stretch down / vertically. I tried to change this so that a specific day / cell would show only a number of areas. For example, maybe one day 20 sectors are attributed to him, however, I only want to show 5 of them and then a text saying 'See more'. The text 'see more' will eventually be a link, but it's far from being the problem.
Initially, the request for this was along the lines of:
select the_id, the_date, the_sector, the sector_abbrev from Table where this = that
It would show all sectors for all the days on the calendar. Yet once, I wanted to limit the output every day as some days would indicate all 20 sectors (their abbreviations), and some would be 3 or four in function. So to say that there are 30 sectors (10 1st), 4 of the 15, 12 on 20-4 on November 29. I want to allow only five abbreviations of sector which must appear in a cell until the link "see more" appears. I came up with the following query:
Select the_sector_abbrev, the_id, the_date, the sector from Table where rownum <= 5 and (this = that) union all Select 'View More', null, null, null from dual
I found that it would be limiting my calendar for showing that four areas throughout the month of November and not for each day / cell on the calendar. I am to discover that 'rownum' is perhaps not the way to go. I don't know how to specify for each of the calendar days rownum. I don't know how to capture every day / the Calendar cell. Maybe I need a more complicated or a subquery where clause. But overall, from my example above, the 1st show four of the sectors and then the link "See more", the 15th would show the four sectors and thats all, the 20th century would show four sectors and her "see more" link and so on.
Any help on this would be greatly appreciated. Thanks in advance.
NewApexCoder wrote:
I had no idea of the possible application of solution would be too complex.
It is not the case:
with calendar_data as ( select ins.sector_abbrev_name , sch.hwe_inspection_scheduling_id , sch.inspection_date , sch.instructions , sch.inspection_sector_id , sch.high_water_event_id , ins.inspection_sector_name , hwe.event_name , row_number() over ( partition by sch.inspection_date order by sch.inspection_date, ins.inspection_sector_name) day_sector_rn from hwe_inspection_scheduling sch left join inspection_sectors ins on sch.inspection_sector_id = ins.inspection_sector_id left join high_water_events hwe on sch.high_water_event_id = hwe.high_water_event_id where ( sch.high_water_event_id = :p0_high_water_event_id or :p0_high_water_event_id is null)) select inspection_sector_id , inspection_date , inspection_sector_name , sector_abbrev_name , ... , null -- Generate URL for sector links here from calendar_data where day_sector_rn <= 5 union all select null , trunc(the_date) + 1 - interval '1' second , null , 'View More…' , ... , null -- Generate URL for "View More..." links here from calendar_data group by the_date having count(*) > 5
Tags: Database
Similar Questions
-
I need a query that selects the amount of records for each day of a table.
I need a query that selects the amount of records for each day of a table.
For example, the result would be:
1 14 date
Date 2-3
etc.
Any ideas?Sort:
SELECT count ([IDCommentaire]), convert (varchar, dateAdded, 112)
OF COMMENTSgroup by convert (varchar, dateAdded, 112)
-
How to find the first max value for each item
Hello
I have the me_result of the table as below,
SELECT * FROM me_result;
ID ||| ELITE ||||||||||| FREQ_ITEM | COMBINED_STR | SUP
1 ||; 1; 10; 2; 3; 4; 5; 7; 8. 1 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
2 ||; 1; 10; 2; 3; 4; 5; 7; 8. 2 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
3 ||; 1; 10; 2; 3; 4; 5; 7; 8. 3 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
4 ||; 1; 10; 2; 3; 4; 5; 7; 8. 4 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
5 ||; 1; 10; 2; 3; 4; 5; 7; 8. 5 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
6 ||; 10; 2; 3; 4; 5; 8; 9. 1 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9; 1 ||| 1
7 ||; 10; 2; 3; 4; 5; 8; 9. 2 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
8 ||; 10; 2; 3; 4; 5; 8; 9. 3 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
9 ||; 10; 2; 3; 4; 5; 8; 9. 4 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
10 ||; 10; 2; 3; 4; 5; 8; 9. 5 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
I need to find the first COMBINED_STR max for each element of the ELITE,
I mean, max value is the max REGEXP_COUNT (combined_str,' ;')))
really, I try to write down, but I had a lot of values for each ELITE and I need only the first, that
SELECT * from me_result
WHERE (ELITE, REGEXP_COUNT (combined_str,' ;')))) IN
(SELECT ELITE, MAX (REGEXP_COUNT (combined_str,' ;'))))) ME_RESULT ELITE GROUP);
I need the result to be as below.
1; 1; 10; 2; 3; 4; 5; 7; 8-1; 1; 10; 2; 3; 4; 5; 7; : p
6; 10; 2; 3; 4; 5; 8; 9 1; 10; 2; 3; 4; 5; 8; 9; 1 1
any help please,.
Published by: user11309581 on July 10, 2011 22:03Can be
with t as (select 1 ID, ';1;10;2;3;4;5;7;8' ELITE, 1 FREQ_ITEM, ';1;10;2;3;4;5;7;8' COMBINED_STR, 2 SUP from dual union all select 2 ,';1;10;2;3;4;5;7;8' ,2 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 3 ,';1;10;2;3;4;5;7;8' ,3 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 4 ,';1;10;2;3;4;5;7;8' ,4 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 5 ,';1;10;2;3;4;5;7;8' ,5 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 6 ,';10;2;3;4;5;8;9' ,1 ,';10;2;3;4;5;8;9;1' ,1 from dual union all select 7 ,';10;2;3;4;5;8;9' ,2 ,';10;2;3;4;5;8;9' ,2 from dual union all select 8 ,';10;2;3;4;5;8;9' ,3 ,';10;2;3;4;5;8;9' ,2 from dual union all select 9 ,';10;2;3;4;5;8;9' ,4 ,';10;2;3;4;5;8;9' ,2 from dual union all select 10 ,';10;2;3;4;5;8;9' ,5 ,';10;2;3;4;5;8;9' ,2 from dual ) select ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP from ( SELECT ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP, ROW_NUMBER() over (PARTITION BY ELITE order by id) RN FROM t WHERE (ELITE,REGEXP_COUNT(combined_str,';')) IN (SELECT ELITE,MAX(REGEXP_COUNT(combined_str,';')) FROM t GROUP BY ELITE) ) where RN=1 order by id ID ELITE FREQ_ITEM COMBINED_STR SUP ---------------------- ----------------- ---------------------- ----------------- ---------------------- 1 ;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8 2 6 ;10;2;3;4;5;8;9 1 ;10;2;3;4;5;8;9;1 1
-
Select the last value for each day of the table
Hello!
I have a table that contains several measures for each day. I need two queries on this table, and I'm not sure how to write them.
The table stores the rows (sample data)
Explanation of the data in the sample table:*DateCol1 Value Database* 27.09.2009 12:00:00 100 DB1 27.09.2009 20:00:00 150 DB1 27.09.2009 12:00:00 1000 DB2 27.09.2009 20:00:00 1100 DB2 28.09.2009 12:00:00 200 DB1 28.09.2009 20:00:00 220 DB1 28.09.2009 12:00:00 1500 DB2 28.09.2009 20:00:00 2000 DB2
We measure the size of the data files belonging to each database to one or more times a day. The value column indicates the size of the files of database for each database at some point (date in DateCol1 European model).
What I need:
Query 1:
The query must return to the last action for each day and the database. Like this:
Query 2:*DateCol1 Value Database* 27.09.2009 150 DB1 27.09.2009 1100 DB2 28.09.2009 220 DB1 28.09.2009 2000 DB2
The query should return the average measurement for each day and the database. Like this:
Could someone please help me to write these two queries?*DateCol1 Value Database* 27.09.2009 125 DB1 27.09.2009 1050 DB2 28.09.2009 210 DB1 28.09.2009 1750 DB2
Please let me know if you need further information.
Published by: user7066552 on September 29, 2009 10:17
Published by: user7066552 on September 29, 2009 10:17Why two queries when it suffice ;)
SQL> select dt 2 , db 3 , val 4 , avg_val 5 from ( 6 select dt 7 , val 8 , db 9 , row_number () over (partition by db, trunc (dt) 10 order by dt desc 11 ) rn 12 , avg (val) over (partition by db, trunc (dt)) avg_val 13 from test) 14 where rn = 1 15 order by dt 16 / DT DB VAL AVG_VAL --------- ----- ---------- ---------- 27-SEP-09 DB2 1100 1050 27-SEP-09 DB1 150 125 28-SEP-09 DB2 2000 1750 28-SEP-09 DB1 220 210
-
SQL - last selection query save values for each date in term
Hello
Can anyone help me please with my problem.
I'm trying to get the last balance recorded for each day of specific box (1 or 2) in a given period of days of the database ms access using ADOTool.
I'm trying to get this information with SQL query but so far without success.
My table looks like this:
Name of the table: TestTable
Date Time Location Box Balance 20.10.2014. 06:00:00 1 1 345 20.10.2014. 12:00:00 1 1 7356 20.10.2014. 18:45:00 1 1 5678 20.10.2014. 23:54:00 1 1 9845 20.10.2014. 06:00:02 1 2 35 20.10.2014. 12:00:04 1 2 756 20.10.2014. 18:45:06 1 2 578 20.10.2014. 23:54:10 1 2 845 21.10.2014. 06:00:00 1 1 34 21.10.2014. 12:05:03 1 1 5789 21.10.2014. 15:00:34 1 1 1237 21.10.2014. 06:00:00 1 2 374 21.10.2014. 12:05:03 1 2 54789 21.10.2014. 15:00:34 1 2 13237 22.10.2014. 06:00:00 1 1 8562 22.10.2014. 10:00:00 1 1 1234 22.10.2014. 17:03:45 1 1 3415 22.10.2014. 22:00:00 1 1 6742 22.10.2014. 06:00:05 1 2 562 22.10.2014. 10:00:16 1 2 123 22.10.2014. 17:03:50 1 2 415 22.10.2014. 22:00:10 1 2 642 23.10.2014. 06:00:00 1 1 9876 23.10.2014. 09:13:00 1 1 223 23.10.2014. 13:50:17 1 1 7768 23.10.2014. 19:47:40 1 1 3456 23.10.2014. 21:30:00 1 1 789 23.10.2014. 23:57:12 1 1 25 23.10.2014. 06:00:07 1 2 976 23.10.2014. 09:13:45 1 2 223 23.10.2014. 13:50:40 1 2 78 23.10.2014. 19:47:55 1 2 346 23.10.2014. 21:30:03 1 2 89 23.10.2014. 23:57:18 1 2 25 24.10.2014. 06:00:55 1 1 346 24.10.2014. 12:30:22 1 1 8329 24.10.2014. 23:50:19 1 1 2225 24.10.2014. 06:01:00 1 2 3546 24.10.2014. 12:30:26 1 2 89 24.10.2014. 23:51:10 1 2 25 ...
Let's say that the period is 21.10.2014. -23.10.2014. and I want to get the last balance recorded for zone 1. for each day. The result should look like this:
Date Time Location Box Balance 21.10.2014. 15:00:34 1 1 1237 22.10.2014. 22:00:00 1 1 6742 23.10.2014. 23:57:12 1 1 25
So far, I managed to write a query that gives me the balance so that a SINGLE date (date more time in the table), but I need balance for EACH date in a specific period.
My incorrect code (has not managed to implement "BETWEEN" for the dates...):
SELECT TestTable.[Date], TestTable.[Time], TestTable.[Location], TestTable.[Box], TestTable.[Balance] FROM TestTable WHERE Time=(SELECT MAX(Time) FROM TestTable WHERE Location=1 AND Box=1 );
TNX!
NP
Here's the correct query (just copy - paste):
SELECT T1.Date, T1.Time, T1.Location, T1.Box, T1.Balance FROM TestTable T1 INNER JOIN ( SELECT MAX(Time) AS Max_Time FROM TestTable WHERE Location=1 AND Box=1 AND Date BETWEEN #10/27/2014# AND #11/1/2014# GROUP BY Date) T2 ON T1.Time=T2.Max_Time;
The problem is in the SELECTION within the INNER JOIN. This SELECTION selects the time max for each date, because we want this and then the entire table, we choose filelds we want, but now we have only fields with the time max.
Here is a really good explanation of INNER JOIN if anyone is interested--> JOINT INTERNAL
Peace!
-
Max and Min value for each column
Hello!
Can someone help me to change my. VI? I want to get the Min and Max value for each column in the table in the appendices. Then I need to create two tables 1 d - the first with the min and the second with the max value.
I've already solved the problem the solution is below
-
PXI-6120 HAVE values only show the low limit values
Hello, I use a PXI-6120 with traditional DAQ driver module screws switch a signal of AI to a PFI channel that allows synchronization of area of OCCUPANCY the AI. In order to measure a single channel of AI with the same set-up, I stopped the criterion VI and tried to see the only measure max. Unfortunately, I opened a task DAQmx, I created for another application, which does not work probably because I have not reset the card after the stop of the VI. Since then, readings of IT are all flat on the lower limit values and the OD has remained at about 0.2 volts any value I write for her. In the meantime, I tried to reset and to recalibrate the device, which worked in DAQ and DAQmx (not the self-calibration in mx). But I have the impression, that the Council has kind of stuck in a State that I can't easily find and/or access. Does anyone have an idea, how can I do a factory reset, or what could be the problem? Greetings! Olli
-
How to assign the ID of group for each group in the SQL query.
Hi all
I want to assign the ID of group for each group (group ID of series). I tried with the row_number function but did not work for my requiredment. Here is my sample data and my requirement.
Col1 A A A A A B C D D D D E E E F G G G I want to get number of each column with ID group assign to it value. Here is my example output
Col1 County Group ID A 5 1 A 5 1 A 5 1 A 5 1 A 5 1 B 1 2 C 1 3 D 4 4 D 4 4 D 4 4 D 4 4 E 3 5 E 3 5 E 3 5 F 1 6 G 3 7 G 3 7 G 3 7 Select col1, count (1) NTC (col1 partition).
ROW_NUMBER() over (partition by col1 by col1 order) tbl_test grp_id.
Please help me solve this problem.
SELECT
COL1,
COUNT (*) ON MYCOUNT (COL1 PARTITION).
DENSE_RANK () OVER (ORDER BY COL1) GROUPID
Of
T1;
-
The FRA diskgroup separate for each prod database?
Hello
Env: Oracle 11 g 2 EE (11.2.0.3), 6.2 RHEL 64 bit
Storage: file system
Databses: ten databases on the PROD and 20 on the DEV
I have two existing servers with above configuration - a DEV and a single PROD. I have to move all of the databases from two servers to new servers.
I have two options. Configure the servers again exactly the same way (same software oracle, same mounts-points, directory structures, etc.) and move/copy the databases above. The other option is to use ASM for storage instead of file system.
Customer asks a diskgroup FRA separate for each DBA database. His reason is that if the FRA gets filled by archivelogs because of some process in the databases, all databases stops responding.
- It's a legitimate concern and what is the best way to deal with this kind of situation?
- Should I create a diskgroup FRA separate for each database?
The archivelogs are backed up every 20 minutes for each PROD database.
Please advise!
Best regards
You can limit FRA for each database with the parameter DB_RECOVERY_FILE_DEST_SIZE.
-
WHY THE PGA IS REQUIRED FOR EACH USER?
Hello everyone;
I have a question about PGA.
WHY THE PGA IS REQUIRED FOR EACH USER?
What I got from google...
Even if information analysis of SQL or PL/SQL is already available in the library of shared pool cache,
the value that the user want to execute the statement select or update cannot be shared.
I can't realize that someone can show an example of clear, if possible?
DB version is 10.2.0.4.0
OS: oracle linux 5.5
Thanks in advance...
PGA is memory private belonging to a specific user. This private memory contains of these pieces that is not supposed to be shared with others. For example, when you sort a part of the data, that does not mean all he wants too. If Oracle retains the sorted data requested by you in your own PGA. Similarly, if you want to query a table with a value of 10, it does not mean that all want the same thing. If these structures are stored in the PGA. For a more detailed description, read the link given by Hoek.
HTH
Aman...
-
PSE8 - "date taken" set a fixed value for each edited image
I've been monkeying with PSE8 for 6 months or more - not using the Organizer, but straight in the edition.
In general, I'll create a template to a certain size (e.g., 1800 x 1200 pixels for printing 6 x 4 photos) and place an image on the template.
After editing, I'll save the file under a new name in a new folder... and have noted recently that the "Date" property changed to exactly the same value for each image editing. 25/09/2010... Maybe it was the date of installation, I am not sure.
In any case - it of annoying and has been touching to find help (which makes sense) online.
Thanks in advance for any help you can give me.
Possibly the date the template was created? PSE respects the camera EXIF data and always displays the date taken, but for digital images and new documents created in the program, it will use the file date.
-
I have copy of old tbird and seamonkey e-mail files with the files and emails for each. I need to add to new tbird install. can not find a way to do it. HELP PLEASE. previous e-mail files are under mail then mail.earthlink* .net and each of the five mail .net is an email address I have. I can't find a way to identify each file by email to the specific email address (IE mail.my E-mail name.net) so I can copy the files and emails from the past to the email addresses now under tbird. previous installed e-mail identities may not be the current configuration of e-mail files in tbird. I think that I must be sure that mail.name.net matches the previous mail.name.net to be able to copy and paste the old to the new. is there a way to find the file name correct the old email and correspond to the new? all my emails very important information are mostly in the old mail electronic id and must be available in the identification of email again (but same) how can I do this?
http://KB.mozillazine.org/Importing_folders
Use this module.
https://addons.Mozilla.org/en-us/Thunderbird/addon/ImportExportTools/
-
Need to find the version number referring to the last name change for each emplid.
emplID Name age Version --- ----- --- -------- 1 ABC 25 2 1 ABC 26 5 1 def 27 9 1 def 28 15 1 def 29 18 2 JKL 15 5 2 MNO 16 8 2 MNO 17 11 2 PQR 18 20 Need to find the version number referring to the last name change for each emplid.
As indicated by the version number change when there is change in age as well, but I need a query that gives the version number referring to the last name change for each emplid.
with
DATA_TABLE (EmplId, Name, Age, version) as
(select 1, 'abc', 25, 2 double Union all
Select 1, 'abc', 26, 5 Union double all the
Select 1, 'def', 27, 9 double Union all
Select 1, 'def', 28, 15 double Union all
Select 1, 'def', 29, 18 double Union all
Select 2, 'jkl', 15 5 Union double all the
Select 2, 'mno', 16, 8 double Union all
Select 2, 'mno', 17, 11 double Union all
Select 2, 'pqr', 18, 20 double
)
Select emplid,
Max (Name) name of Dungeon (dense_rank last order by version).
Max (Age) age of Dungeon (dense_rank last order by version).
version Max (version)
from (select emplid, name, version,)
-case where name! = lag(name,1,name) on (emplid version order partition)
then "renamed".
end change
of data_table
)
where the change is not null
Emplid group
EMPLID NAME AGE VERSION 1 def 27 9 2 PQR 18 20 Concerning
Etbin
-
Is it possible to create a tag that lists the individual labels [keywords] for each position? The current {tag_blogtaglist} creates an endless list of tags.
If you can get hands on with the ID of blog post that you can list the tags assigned to this post particularly blog using module_data. It would be only possible with the new BC. Active following rendering engine. Here are some resources to point you in the right direction: how to activate the BC. Next - http://docs.businesscatalyst.com/developers/liquid/introduction-to-liquid#enable how to use module_data - odule_data http://docs.businesscatalyst.com/developers/liquid/consuming-apis-in-the-front-end-using-m install app BC API discovered to get you started on the syntax - http://docs.businesscatalyst.com/developers/apps/bc-api-discovery module data that lists the tags assigned to a blog post looks like this: {module_data = 'blogposts' version = "v3" field resource = subresource 'tag' = "tags" resourceId = collection "303870" = "myData"} resourceId is the blog ID to render tags for. Hope this helps, Mihai
-
Delete based on specific hours for each day
Hello
I have a table with a field of date DD-MM-YYYY HH:MIN:SS
Table contains date since 2006 and I just need to keep the entries with date DD-MM-YYYY 00:00 (midnight only registers for each day)
Thanks in advance for any help.drbiloukos wrote:
... ... ... 14-JAN-13 14-JAN-13 12:01:00 14-JAN-13 12:01:05 14-JAN-13 12:02:03 14-JAN-13 12:01:55 14-JAN-13 12:02:13 15-JAN-13 15-JAN-13 12:01:00 15-JAN-13 12:01:05 15-JAN-13 12:02:03 15-JAN-13 12:01:55 15-JAN-13 12:02:13 ... ... ...
just need to keep accounts with
...
14 JANUARY 13
15 JANUARY 13LUN-JJ-AA 00:00
that
delete from table where date_col != trunc(date_col); or to keep the data update table set date_col = trunc(date_col)
or you can add the new column
alter table table_name add (new_date date);
and update
update table table_name set new_date = TO_DATE(TO_CHAR(old_date,'DD.MM.YYYY HH24:MI')||':00', 'DD.MM.YYYY HH24:MI' )
Published by: Bawer on 16.01.2013 12:03
Maybe you are looking for
-
create duplicates with the mantissa and the exponent
I have DAQ two analog values of a detector leak helium: a signal is a step function indicating an exponent (between 1 and 10 Volts, not 0.5 V) and the other signal indicates the mantissa in the range of 1-10 V. I take the mantissa value as it is, and
-
LaserJet CP1025nw on MACBOOK and no wifi
My macbook automatically installs the printer drivers. (the CD with installation software does work with my latest IOS), so now I can print with the USB cable. BUT no WIFI connection, I couldn't get the wifi connection works between the printer and t
-
Hello I'm trying to update the firmware of the phone SPA504G. They are currently in version 7.5.2. I have download spa50x-30-x-7-5-7 s .bin and spa50x-30 x-7-5 - 7 s .exe. It is an unlocked version of the phone as the administrator password is blank?
-
Can I switch to official Windows 7 Windows 7 RC?
Can I switch to official Windows 7 Windows 7 RC?
-
BlackBerry smartphone error: could not open file
When I go into my computer to view the videos that I transferred my phone... it gives me a box that says: cannot open the file. Images and ringtones show very well. How to make videos to show on my laptop?