Group sorting problems

I have three tables in a management system of contacts that I use. The first is the prmContacts with First, Last and other info. The second is prmFollowup which refers to the prmContactID and contains a comment and in the field of the appointment. The third is a prmInfo that contains the name of the company and the active/inactive status.

I need to generate a repeating list which contains the name, name, company name and fields of appointment. I've got evertything worked except that I can't seem to make the attraction info displayed up to the last field of appointment.

Here is my SQL query.

$query_activeContactsRS = "SELECT prmContacts.id, prmContacts.custFname, prmContacts.custLname, prmInfo.companyName, prmFollowup.nextAppointment, prmFollowup.nxtTime.

OF prmContacts, prmInfo, prmFollowup

WHERE the prmContacts.id = prmFollowup.prmContactID AND prmInfo.prmContactID = prmFollowup.prmContactID AND prmContacts.custActive = 'Yes '.

GROUP BY prmContacts.id DESC

ORDER BY prmFollowup.id DESC";

Let's talk about the request. Match the customer contact and the prmFollowup is perfect. The GROUP OF prmContacts.id keep duplicate for each prmContact.id entries shows upward so that I find myself with a list of only my contacts. Although the GROUP BY method, I find myself with a new line for each field of prmFollowup. What I want is just the last displayed the tracking record. With this request I display the first row of follow-up.

If anyone has any ideas on how to make this work please let me know. At this point, that the only work-around, I can think of involves a link to another page to view the next apporintment for the contact.

> This should not be so difficult.

It is not, but you should know a few things. The most simple is to create a list of IDS that meet your selection criteria - that is, get the max (ID) to each contact - and then use it in the WHERE clause of the main, SELECT

This will produce the list of identifiers that you need for each contact.

SELECT Max (prmFollowUp.ID) AS MaxOfID

OF prmFollowUp

GROUP BY prmFollowUp.contact;

Include in the main statement like this:

SELECT contacts, favColor

OF prmFollowup

WHERE ID in

(SELECT Max (ID)

OF prmFollowUp

Contact GROUP)

There are other ways to do it too - using correlated subqueries and derived tables. If you do not have as many lines probably little matter, but as your number of lines increases you can optimize by using one of these other methods. Here is an example: http://stackoverflow.com/questions/438938/sql-server-only-last-entry-in-group-by

Tags: Dreamweaver

Similar Questions

  • SanDisk Clip + sort problem

    Hi all, I read the previous messages in the forum about this problem but nothing is me helped.  I call my mp3 music (more than 2000 of them) starting with an acronym of 3 letters for the band, and then a number that corresponds to the order I want the song to play in this particular group (ex: Frank Zappa songs = ZPA 01 first song name, ZPA 02 second name of the song, ZPA 03 third name of the song) etc.).  Many of my albums are structured with 1 song merging into another, so it is crucial that they play in the proper order.  It works fine when I go to 'Music'-> 'Play All' on my clip +.  Problem is if I go to the 'music '->' artists'-> 'Play All' they are in a competely different order!  Even when I do a different type of subselect as 'Music'-> 'Types '->' Play All'.

    I need to be able to select a specific artist, and control the order of the songs from this artist, so can someone tell me:

    (1) why this happens?

    (2) what can I enter in the MP3 tag which specific for it to sort the way I want to force?

    Thank you!

    Artist, Album, Genre are all labels. No records. The Clip concludes these labels ID3 Tags.

    But if you click on to the bottom of the artist, Album, etc., you'll see the folders. You can read the file in the order the names of the tracks.

    Play everything probably goes into music, and I play through each Album in alphabetical order by title of the album.

    Or you can fix the ID3 tags.

    Download the free program mp3tag. http://www.mp3Tag.de/en/

    When you install it let it be added to the context menus (an option during installation).

    After installed, open it and go to tools, Options, Tags, Mpeg and under writing choose ID3v2.3 and ISO-8859-1. (ISO-8859-1, this is how Windows displays the text in the English language).  Make sure that those who are saved.

    Click on an album, and then look at the tags. Click on the header name of the file to put in order - as you did the names of files - and then fill in the other fields correctly. You can labelled the album both highlighting everything and put the artist, Album, etc. in the box on the left.

    MP3 tag also has some other nifty features. One is assistant tools/auto-numbering. Make sure the files are in order, from top to bottom, reading, choose the option of leading zeros. If an album has 10 tracks and they are labeled, 1, 2, 3, etc., the Clip will play 1, 11, 12, 13, before 2.  This is perhaps what is happening. Leading zeros fixed that.

    Under Convert, you can convert your files in tag names.  It's pretty obvious, how it works, each field is shown by the artist %, etc.  So in the conversion box, you can type ZPA Track %%d % title % and he should ignore ZPA and fill in the other fields. This could be your best option, but mp3tag is very flexible, and you should understand something.

    It is best to take off the Clip files problem, fix them on the computer and return. You can also remove MTABLE. SYS of the clip - which is the database of the ID3 tags - and when you unplug it will make a fresh shiny new MTABLE. SYS to your new tags.

    Further, it takes about 5 seconds to run the wizard to autodial on each album, until you add it to the clamp and it will prevent many problems.

  • Problem of Skype calls groups calls problem/video group

    Hello

    I use Skype on Samsung Galaxy A5 (A500FU) and I can not start a group call / or call groups like the button 'call' in the upper right corner is missing. Same problem with group video calls (call button is missing).

    I use the latest version of Skype for Android - 6.33.0.575

    Any ideas?

    Thanks in advance

    Skype has solved the problem in version 7.01.0.669 of 31.05.2016. After the update the Group calls (video & audio) work correctly.

    I must say that I am really impressed with their customer service. I explained the problem in detail and in the next update, the problem has been resolved. All people using Skype on Samsung Galaxy A5 will be very happy

    Thank you

  • Group chat problem

    Hello!

    I have problem with Skype for two days now.

    I have two important chat group on Skype (no application or video, simply chatting).

    First consolidated 24 people and is second of three people

    I can't see all of the messages or send them on gropup. I can't not also leave group or re - join.

    Reinstall did not help.

    What could be the next step? Questions questions/video call but no questions, all help topics are connected with simple cat (that I found on help )

    see you soon

    Edit:

    I forogot talk I use windows 10 (updated) and it is 32-bit.

    Ok!

    If you own hosts and you erased your story and still can't in the chat group, make sure you're usening avast antivrius.

    If so just update (force the update) and it should fix the problems!

  • Playlists sort problems after upgrading to iTunes 12.3.2.25

    Hello.

    My system is 64-bit Windows 10 and everything was fine until I upgraded to (today) to iTunes version 12.3.2.25.

    Now I see that, although my old playlists are always sorted alphabetically, each new playlist that I create is placed at the end of my list (at the bottom, the very last, regardless of the letter, that it starts from)!

    Anyone else having this problem?

    Thank you in advance.

    p.s. Should I restore my system to the restore point that I created just before I installed this version? It will bring me to the previous version that worked without problems?

    Yes, I guess that creating a Restore Point before each update of iTunes is a necessary step in our days... Well, I learned my lesson.

    Only, I restored my system to the restore point that I took just before the update to iTunes, she went back to the 12.3.1.23 version and playlists are now sorted properly...

  • WISN and Group RF problem

    We have on WISN version 4.0.155.5. We have set up a group name of RF for two controllers in the WISN and use auto-RF. The problem is each controller can be seen in the RF group and considers himself to be the head of the RF group. My understanding is everyone should see two controllers of the RF group and only should be the head of the RF group. Where could be the problem?

    I posted the following in your other thread:

    You still have APs on the two WiSMs? They will see only other members of the RF group who have APs related to them. I had the same issue, but when I moved 1 AP for each group of WISN the RF came up as planned.

  • ATG 10.2 CSC ticket history sort problem

    Hello

    I am facing an issue related triage in the grid of 'Historical Ticket' of the CSC.

    In this grid, there are several columns - ticket Id, Description, creates, age, status, but the sort option only works when I click on the 'ticket Id' column.

    By clicking on the sign of the arrow next to the ticket Id, all columns are get sorted but same behavior does not work when I click on the other columns -Description, creation, status, age.

    I tried to console alert in various jsp but unable to find so exact of these columns are rendered.

    I know that these grid/table are defined in /Service-UI/Framework/Agent/config/atg/svc/agent/ui/tables/ticket/CustomerTicketGrid.properties but of jsp perspective I'm not able to understand.

    Can anyone suggest / Help on this issue?


    TicketHistory.jpg


    Kind regards

    Prateek Gupta


    I am able to fix this by myself.

    There is no need to find jsp; It is a configuration problem.

    We need only set the sortField property and sorting works fine then.

    Kind regards

    Prateek Gupta

  • Port of the Machine Group virtual problem in VSS

    Hello

    ESXi host: 172.16.12.70

    Running 3 VMs.

    All work of things right last day, now I've lost the network connectivity of virtual machines, but I can access ESXi host using VCenter, it shows me there is no virtual machine in "Virtual Machine Port Group.

    What will be the Cause of this problem?

    Snapshot are attached

    Right click on the VM-> change settings of-> click on the NIC-> choose which network it belongs to the drop-down list.

  • automatically generated GROUP BY problem

    I Autogenerate GROUP BY clause and Synchronize it checked by increment, (really good service, thank you!) and noticed some problems.

    (1) by typing SELECT A, B, COUNT (*) from a causes GROUP BY must be generated, taking a. causes a second GROUP BY must be generated. Ending with:
    SELECT A, B, COUNT (*) of a. Group by group by A, B A, B

    (2) the first element of the list does not appear to be updated:
    SELECT moo, cow, count (*) cow group by moo, cow;

    If I add a one for the cow, the clause is updated. If I add a one-for-moo, however, is not.

    Thanks Brian, fixed.

  • Sort problem: ORDER BY the numbers all first instead of characters first

    Hello

    I need help with the problem of the following sort:

    create table test01 (sorting_column varchar2 (30));

    insert into values test01 ('Test123');
    insert into values test01 ("Test987");
    insert into values test01 ("123Test");
    insert into values test01 ("987Test");
    insert into test01 values (string 'test');

    Select sorting_column from test01 arrested by sorting_column;

    SORTING_COLUMN
    ------------------------------
    Test string
    Test123
    Test987
    123Test
    987Test

    This is not the order that I need. I really wish it were (numbers before characters):

    123Test
    987Test
    Test123
    Test987
    Test string

    Can anyone help?

    Thanks in advance,
    Marc
    SELECT sorting_column
    FROM test01
    ORDER BY nlssort(sorting_column, 'NLS_SORT=BINARY')
    ;
    

    Can be set at the level of the session as well:

    ALTER SESSION SET NLS_SORT = BINARY;
    

    Published by: odie_63 on June 20, 2011 17:45

  • Oracle matrix report - sorting problem

    I have developed a relationship of type matrix in the query I wrote the correct sort order. If I run the query in the TOAD sort order is correct. Display of the data on the report is to give the problem the sort order is different. Could you please tell me is it possible to get the desired sort order.

    In a matrix, you can manage the sort order of the rows/columns by going directly in the field presentation and changing the order of the breakdown, by default the pause command is growing... so your columns/rows are already sorted by default.

    I guess you try to get a descending order, and that's what you see not applied with your ORDER BY clause...

  • Crosstab sort problem

    Hi all, I have the following XML
    <LIST_G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>920486</ID>
    <NAME>MLF Ltd</NAME>
    <DATE_ID>2009-04-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>04/30/2009</BEGIN_DATE>
    <PCT>.76</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>920486</ID>
    <NAME>MLF Ltd</NAME>
    <DATE_ID/>
    <MONTH_YR>2009-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2009 Avg.</BEGIN_DATE>
    <PCT>.76</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2008-11-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>11/30/2008</BEGIN_DATE>
    <PCT>.551</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2008-12-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>12/31/2008</BEGIN_DATE>
    <PCT>.608</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2009-01-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>01/31/2009</BEGIN_DATE>
    <PCT>.59</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2009-02-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>02/28/2009</BEGIN_DATE>
    <PCT>.549</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2009-03-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>03/31/2009</BEGIN_DATE>
    <PCT>.576</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID>2009-04-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>04/30/2009</BEGIN_DATE>
    <PCT>.726</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2009-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2009 Avg.</BEGIN_DATE>
    <PCT>.61025</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2008-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2008 Avg.</BEGIN_DATE>
    <PCT>6.90583333333333333333333333333333333333E-01</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>274</ID>
    <NAME>Capital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2007-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2007 Avg.</BEGIN_DATE>
    <PCT>1.10675</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2008-11-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>11/30/2008</BEGIN_DATE>
    <PCT>.725</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2008-12-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>12/31/2008</BEGIN_DATE>
    <PCT>.713</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2009-01-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>01/31/2009</BEGIN_DATE>
    <PCT>.6</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2009-02-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>02/28/2009</BEGIN_DATE>
    <PCT>.557</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2009-03-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>03/31/2009</BEGIN_DATE>
    <PCT>.582</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID>2009-04-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>04/30/2009</BEGIN_DATE>
    <PCT>.73</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2009-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2009 Avg.</BEGIN_DATE>
    <PCT>.61725</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2008-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2008 Avg.</BEGIN_DATE>
    <PCT>.8865</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>12</ID>
    <NAME>GCapital LP</NAME>
    <DATE_ID/>
    <MONTH_YR>2007-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2007 Avg.</BEGIN_DATE>
    <PCT>1.47333333333333333333333333333333333333E00</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2008-11-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>11/30/2008</BEGIN_DATE>
    <PCT/>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2008-12-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>12/31/2008</BEGIN_DATE>
    <PCT>.705</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2009-01-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>01/31/2009</BEGIN_DATE>
    <PCT>.617</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2009-02-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>02/28/2009</BEGIN_DATE>
    <PCT>.562</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2009-03-01T00:00:00.000-06:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>03/31/2009</BEGIN_DATE>
    <PCT>.587</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>x</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID>2009-04-01T00:00:00.000-05:00</DATE_ID>
    <MONTH_YR/>
    <BEGIN_DATE>04/30/2009</BEGIN_DATE>
    <PCT>.733</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID/>
    <MONTH_YR>2009-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2009 Avg.</BEGIN_DATE>
    <PCT>.62475</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID/>
    <MONTH_YR>2008-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2008 Avg.</BEGIN_DATE>
    <PCT>.705</PCT>
    </G_EXP>
    <G_EXP>
    <ORD>y</ORD>
    <ID>135</ID>
    <NAME>Fund Ltd</NAME>
    <DATE_ID/>
    <MONTH_YR>2007-01-01T00:00:00.000-06:00</MONTH_YR>
    <BEGIN_DATE>2007 Avg.</BEGIN_DATE>
    <PCT>2.26833333333333333333333333333333333333E00</PCT>
    </G_EXP>
    </LIST_G_EXP>
    My crosstab looks like below..
    (1,1)<?horizontal-break-table:1?>
    (1,2)<?for-each-group@column:G_EXP;./BEGIN_DATE?><?sort:ORD;'ascending';data-type='text'?><?sort:DATE_ID;'ascending';data-type='text'?><?BEGIN_DATE?><?end for-each-group?>
    (2,1)<?for-each-group:G_EXP;./NAME?><?variable@incontext:G1;current-group()?><?NAME?>
    (2,2)<?for-each-group@cell://G_EXP;./BEGIN_DATE?><?sort:ORD;'ascending';data-type='text'?><?sort:DATE_ID;'ascending';data-type='text'?><?($G1[(./BEGIN_DATE=current()/BEGIN_DATE)]/PCT)?><?end for-each-group?><?end for-each-group?>
    My current output for column headings is...I'm unable to provide my whole o/p here due to space constrains I guess..
                 11/30/2008 12/31/2008 01/31/2009 02/28/2009 03/31/2009 04/30/2009 2007 Avg. 2008 Avg. 2009 Avg.
    Can I get something like...Check the last 3 columns...
                 11/30/2008 12/31/2008 01/31/2009 02/28/2009 03/31/2009 04/30/2009 2009 Avg. 2008 Avg. 2007 Avg.
    Thanks in advance..
    Published by: user10280715 on May 28, 2009 13:05

    I think 4 + ways of dealing with this right now.

    One:
    Separate the grouping based on the data and the year of the avg.
    the solution is below.

    1,1 = 
    1,2 = 
             
             
             
    1,3 = 
             
             
            
    2,1 = 
    2,2 = 
             
             
             
    2,3 = 
             
             
             
             
    

    two:
    Simply adding the desc in the field of the MONTH_YR.

    1,1 = 
    1,2 = 
           
           
           
           
           
    2,1 = 
           
           
    2,2 = 
           
           
           
           
           
           
    

    Third:

    If you want to reduce sorting in RTF, that I prefer, then may be small change in the query is required.

    Delete the order of 3,1,4,5 desc of the query, since your order and the sorting is done in RTF ;)
    It is useless code, unless you need it for other reasons.

    Use the same RTF you have. and use the following query.

    SELECT 'x' ord,
           id,
          name,
           to_date(month_begin_date_id,'YYYYMMDD') date_id,
           null month_yr,
           to_char(last_day(to_date(month_begin_date_id,'YYYYMMDD')),'MM/DD/YYYY') begin_date,
           pct/100 pct
    from tables.
    union
    SELECT 'y'||10000-to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') ord,
           id,
           name,
           null,
           trunc(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') month_yr,
           to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') || ' Avg.' begin_date,
           avg(pct/100) pct
    from tables.
    group by 'y'||10000-to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY'),
             id,
             name,
             trunc(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY'),
             to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY')
    

    Fourth:
    I prefer to reduce sorting in model;).
    I like to take the burden of the model ;) and give the beautiful Monster database to manage heavy work.

    SELECT 'x'||month_begin_date_id ord,
           id,
          name,
           to_date(month_begin_date_id,'YYYYMMDD') date_id,
           null month_yr,
           to_char(last_day(to_date(month_begin_date_id,'YYYYMMDD')),'MM/DD/YYYY') begin_date,
           pct/100 pct
    from tables.
    union
    SELECT 'y'||10000-to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') ord,
           id,
           name,
           null,
           trunc(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') month_yr,
           to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY') || ' Avg.' begin_date,
           avg(pct/100) pct
    from tables.
    group by 'y'||10000-to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY'),
             id,
             name,
             trunc(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY'),
             to_char(to_date(month_begin_date_id,'YYYYMMDD'),'YYYY')
    
    I assumed the month_begin_date_id columns holds the data in YYYYMMDD format.
    else use to_char function to convert it to YYYYMMDD 
    

    And in the template, remove sorting on DATE_ID. Just use spell on DSB ;)
    delete

    (1,1)
    (1,2)
           
           
    (2,1)
           
    (2,2)
           
           
           
    
  • Sorting problems

    Sometimes, when I add music by the same artist, same album yet, it gets split. For example, I just added an album by Terry Reid. Each artist field is called 'Terry Reid' and all areas for the Album are labeled 'Move over for Terry Reid', but instead of all of the songs are classified in the same heading, iTunes creates two more different of the same name. This is a known error? It makes me crazy! Here's a screenshot of what I'm talking about, in case I'm not explaining well enough:

    Any Suggestions?

    Thank you

    -Adam

    Steve MacGuire alias turingtest2 - iTunes and iPod tips and tricks - grouping beaches in Albums - http://www.samsoft.org.uk/iTunes/grouping.asp (old post on Apple Discussions http://discussions.apple.com/message/9910895#9910895)

    Quick response: select all the tracks on the album, file > info (or right-click > news > Details) and give them all a single "album artist", or check the indicator of "compilation" (as in https://discussions.apple.com/message/17670085#17670085).

    If they are several CD sets, you will also need to enter the appropriate information in the fields of number of disk.  If they are not a set of multiple CDs that you must always make sure any vacuum or disc number fields are properly defined.

    Another explanation of hhgttg27 August 2015 - https://discussions.apple.com/message/27784417#27784417

    If they won't even really check this August 2008 post by turingtest2 group temporarily change labels - https://discussions.apple.com/message/7904806#7904806 or http://www.samsoft.org.uk/iTunes/merge.asp - it works often but I have had cases where securities combined when a letter has been added but divorced when he was kidnapped again.

    If they are mp3 files are trying to change the version of the ID3 tag, which can cause iTunes to re - write the tags and clarify inconsistencies.  I use iTunes 7.5 (Yes, from 2007) so I can't tell you where it is in later versions.

    I had a case of grouping stubborn reality.  The tracks will be re-group in a way that has no meaning when I changed metadata.  Without going into details, I deleted tracks iTunes completely, then add the files and they are all grouped together correctly.

  • Yahoo group email problem

    Hey guys, mike e here.i have a new toshiba laptop which has worked so far.i belong to a yahoo E.C.I.E. group I recently replied to a message to the group, and now I continue sending the e-mail even without telling me things, sometimes up to 3 - 4 times a day - at least! I deleted the Group (until I have remedy) and he still email twice so far.someone on the deletion of the said inshould of group all sent messages sent on the post and I did all the spam messages all group.then deleted, and then continues to do it.any trash.its ideas.im pretty computer illiterate.thanks for any help, mike e.

    Hi michaelevanchik,

    I suggest you to contact Yahoo support for more help and information.

    http://help.Yahoo.com/l/us/Yahoo/mail/Postmaster/forms_index.html

    http://help.Yahoo.com/l/us/Yahoo/mail/

    http://help.Yahoo.com/l/us/Yahoo/mail/YAHOOMAIL/contactus/index.html

  • Sort problem

    It's sorting"available"by lexigraphic... I don't want coming down from the largest to the smallest.

    Can someone tell me why it is sorting this way and how to fix it?

    < pre >

    #header info

    $style = ' < style > BODY {do-family: Arial;} '. do-size: 10pt ;} »

    $style = $style + "TABLE {border: 1px solid black;}. border-collapse: collapse ;} »

    $style = $style + "TH {border: 1px solid black;}. background: #dddddd; padding: 5px; }"

    $style = $style + "TD {border: 1px solid black;}. padding: 5px; }"

    $style = $style + ' < / style >.

    $report = new-Object - TypeName System.Collections.ArrayList

    {foreach ($cluster Get-cluster)

    Get-VMHost-location $cluster | Get-Datastore. %{

    $info = "$($_.)". Datacenter).

    $info += "$($cluster.)." (Name) ".

    $info += "$($_.)." (Name) ".

    $capacity = [math]: Round($_.capacityMB/1024,2)

    $info += "$($capacity)".

    $provision = ([math]: Round (($_.))) ExtensionData.Summary.Capacity - $_. ExtensionData.Summary.FreeSpace + $_. ExtensionData.Summary.Uncommitted)/1GB,2))

    $info += "$($provision)".

    $Available = ([math]: Round (([math]::Round($_.capacityMB/1024,2)) - ([math]: Round (($_.)))))) ExtensionData.Summary.Capacity - $_. ExtensionData.Summary.FreeSpace + $_. ExtensionData.Summary.Uncommitted)/1GB,2)),2))

    $info += "$($available)".

    $avail = ([math]: Round (([math]::Round($_.capacityMB/1024,2)) - ([math]: Round (($_.)))))) ExtensionData.Summary.Capacity - $_. ExtensionData.Summary.FreeSpace + $_. ExtensionData.Summary.Uncommitted)/1GB,2)),2))

    $capacity = ([math]: Round($_.capacityMB/1024,2))

    $percent = "{0:N2}" f (($avail/$capacity) * 100)

    $info += "$($percent)".

    [void] $report.add ($info)

    }

    }

    $html = "< br br > < br > > <.

    $html += ($report |) ConvertFrom-Csv-Header 'Data center', 'Cluster', 'name', 'Ability', ' service ', 'Available', 'PctFree | 'Available' Tri-objet - descent). ConvertTo-html-head $style

    $html > report.html

    < / pre >

    You can try something like this

    $html = "

    #header info

    $style = " "

    $report = @)

    {foreach ($cluster Get-cluster)

    Get-VMHost-location $cluster | Get-Datastore. %{

    $info = "| Select the center of data, Cluster, name, capacity, put in service, available, PctFree

    $info. DataCenter = $_. Datacenter.Name

    $info. Cluster = $cluster. Name

    $info. Name = $_. Name

    $capacity = [math]: Round($_.capacityMB/1024,2)

    $info. Capacity = $capacity

    $provision = ([math]: Round (($_.))) ExtensionData.Summary.Capacity - $_. ExtensionData.Summary.FreeSpace + $_. ExtensionData.Summary.Uncommitted)/1GB,2))

    $info. Set service = $provision

    $info. Available = $capacity - $provision

    $percent = "{0:P2}" (($capacity-$provision) f / $capacité)

    $info. PctFree = $percent

    $report += $info

    }

    }

    "$html +=".

    "

    $report | Tri-objet-property available - descending | ConvertTo-html-head $style > report.html

Maybe you are looking for

  • Satellite T130 - how to restore Windows 7?

    I bought a new Satellite T130 three days ago. It was pre-installed with Windows 7 Professional, but reckless, I enabled iPv6 and the problem started. The machine asked to restart the computer, but he was not able to start and instead, ask to have a r

  • copy the address book to new computer

    Hi all. I have a Mac Pro 1.1 running OS X 10.6.8 and a Mac Pro 3.1 10.9.5 running. I'm upgrading to an iphone 4 to a 6 s more. I have serious duplication of notes, contacts, and calendar for the last 5 years issues. My iphone 4 has hundreds of dups o

  • Basic Windows file to update the BIOS

    After starting to run the update stops with the message "you must be logged in as an administrator to install this update". I am the administrator only this computer has ever known... using Vista Home Premium 32 bit and try to update the BIOS before

  • What ports must be used between SX20 and Intouch?

    Hello. I'm a junior engineer of telepresence, I face to make matching SX20 and Intouch. They have the same subnet mask and even G/w. with this configuration, I had things qurious. Question, 1. in the event that they must have the same mask subnet and

  • Unstable records and constant notice of improvements that never come.

    I use 13 elements on Windows 10.  (1) I have organized photos by date, but jump out of some photos from a folder to another move of the photos that should be in a folder.  (2) whenever I opened 13 elements, I am get a notice that is waiting for an up