GROUP BY a single field, show all fields

I have this table:
CREATE TABLE Prices(ServiceType VARCHAR2(30), EffectiveDate DATE, Fee NUMBER, Commission NUMBER, PRIMARY KEY(ServiceType, EffectiveDate));
I am trying to write an SQL query to get the ServiceTypes and Fees. However, I only want those with the most recent EffectiveDate.
This is what I have so far:
SELECT ServiceType, Fee, MAX(EffectiveDate) FROM Prices GROUP BY ServiceType;
But that doesn't work because GROUP BY has to be followed by all selected attributes. Does anyone know how to write that query? Thanks in advance,
Nader

Why dont you use a sub query liek below:
SELECT ServiceType
            , Fee
            , EffectiveDate
  FROM Prices    out
WHERE EffectiveDate = ( SELECT MAX(EffectiveDate)
                                         FROM Prices   in
                                      WHERE in.ServiceType = out.ServiceType
                                           AND in.Fee              = out.Fee 
                                  GROUP BY ServiceType
                                                  , Fee
                                    );Regards
Arun

Similar Messages

  • Transported table not showing all fields

    dear all
    can u plz help me i have transported a table but its not showing all fileds. whatcan i doto make it show all fields in the table
    Regards
    Flo

    Hi,
    Are there any custom data elements used in the table.
    if so, is all the data elements transported to the table
    first all the data elements to be transported and then the table should be transported if in case they are
    in different transports.
    Regards,
    Venkatesh

  • Why the ALV download Excel can't show all field title?

    Dear All
             I have a problem for ALV download to Excel
    Example: the field  title description has 11 len bits when I download Excel then the field title is u2018descriptiou2019 only 10 len bits. I found when the field value is more then 11 then can show all,if the field value less than 11 then download Excel only show 10.
    The description has 40 bits.if itu2019s value less 40 then ALV CONDENSE the space .
    I removed this code: GT_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.but problem is also exits.
    How can I do ?
    Thanks

    Make sure you populate below, it may help you to solve your problem. 
    t_fieldcatalog-col_pos     = col_pos.
    t_fieldcatalog-outputlen   = out_len.
    Rgds,
    SaiRam

  • Access 2013 - Query showing all/* fields by default!

    hi - does anyone know why my queries are pulling ALL the fields from a table even though I am only selecting a couple of fields?
    Here's the steps to recreate:
    Create, Query Design
    add table
    drag a couple of fields to display
    So then it shows me ALL the fields in table, so I have to go into SQL and take off the * after Select statement:
    SELECT T_CONTACT.name_last, T_CONTACT.birthday, *
    FROM T_CONTACT;
    but I did not drag the * into my query design!
    Help - this is super annoying!
    thanks!

    Open the query in design view.
    Click in an empty part of the upper pane of the query design window.
    If necessary, activate the Property Sheet (F4).
    Set the 'Output All Fields' property to No:
    You can turn this off as default setting:
    Select File > Options.
    Click Object Designers in the navigation pane on the left hand side.
    Clear the check box "Output all fields" in the "Query design" section.
    Click OK.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to show all fields when we do not enter any data

    Hello all,
    Here i am creating the SSRS reports on SharePoint list data, Report is created successfully but the requirement is that when generation of report if i do not enter value of employee name that time .....I want the report must display all records of all employees.
    Please suggest me.... 

    Hi Anil,
    If I understand correctly, you have create a report use SharePoint list as the datasource. When you run the report, you need to enter value of employee name to display corresponding values.
    If we are use SharePoint list as datasource, we have two method to add parameter in the report.
    Method1: Add filter in the dataset Query Designer dialog box.
    In this situation, if we configure the filter with “(blank)” in the Value dialog box, we will get the situation as your post. In this method, we are get a single value parameter in the report.
    Method2: Add a dataset parameter. Please refer to the steps below:
    Create another dataset (DataSet2) in the report with EmployeeName field.
    Add a parameter (ReportParameter1) in the report. Select “Allow multiple values” option in the General dialog box.
    Click “Available Values” in the left pane, select “Get values from a query”. Please refer to the values below:
    Dataset:     DataSet2
    Value field:    EmployeeName
    Label field:    EmployeeName
    Click “Default Values” in the left pane, select “Get values from a query”. Please refer to the values below:
    Dataset:     DataSet2
    Value field:    EmployeeName
    Right click DataSet1, select DtaSet Properties. Click Filters in the left pane. Please refer to the values below:
    Expression:   [EmployeeName]
    Operator:    In
    Value:   [@ReportParameter1]
    Reference: http://msdn.microsoft.com/en-us/library/dd220464.aspx
    If there are any misunderstanding, please feel free to let me know.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Group Hidden Elements after using show all

    In Illustrator to build files with clean grouping, you can:
    hide various elements
    show all hidden elements
    group them
    In InDesign after you show all hidden elements, the items are not selected.
    Illustrator and InDesign should have a simialr interface, and can see no harm, and only a huge benefit to revising how InDesign works.
    Posted this on the InDesgin forums, and nobody had a solution. As unbelievable as this sounds, appears this has been overlooked by the Adobe beta and development team.
    http://forums.adobe.com/thread/1044095?tstart=30

    @Mike – I rarely missed that feature the last years, but that's because I am using Illustrator not that often. If I think about it more deeply, I could imagine that such a feature would be valuable for InDesign, too…
    What would help you is a script, that can do what you want. Just written one and tested. But before posting code, let's discuss the functionality a bit more:
    What is possible:
    1. A script that addresses all hidden page items (provided they are not locked) on the current spread, pasteboard included, unhide them, group them and selecting the group.
    2. A script that addresses all hidden page items (provided they are not locked) on the current spread, pasteboard included, deselect all currently selected page items, unhide the hidden ones and select them.
    That's all. No grouping…
    I find the second approach more valuable, because  you have the choice what you can do with the selection: delete it, group it, move it around on the spread, move it to another layer etc.pp.
    Also: how about locked page items that are hidden?
    Would it be good to change the document preferences (if needed) so that you could select locked obejects?
    How about a message in case the script detects locked and hidden page items that let you choose:
    [ ] include locked and hidden page items
    My script is in development, so I want to discuss the above points, before proceeding.
    It's written in JavaScript (ExtendScript) so that it can be used on Mac OS or Windows OS.
    And: you could assign a keyboard shortcut to the script…
    Uwe

  • Editing properties of multiple fields causes all fields to resize or shift position

    While editing a form, if I select multiple text fields, right click, and select Properties, all the fields become the same size, or shift their position on the screen. It seems to repeat whatever operation you had previously done before, so for example, if you had previously aligned a couple text fields to the right, then it will do that for all fields. Or, if you had previously set the dimensions of a couple text fields to be the same height and width, then it will now do that for all fields.
    The only workaround is to quit Acrobat and relaunch.
    I would report this as a bug on Adobe's bug report form, but the web page is down.

    I've suffered some issue like that but it was always related to GMPC and in which position it was. Seems that some apps don't resize well with awesome, so I think you should try to trace wich app breaks the resize

  • Unable to show all fields from a table\view within a SSRS Report Model for user selection

    I recently added a new view with a simple SELECT (with 3 fields) statement to our existing Report Model DSV. I then went ahead to the report model (.smdl) file proceeded with the auto-generation of the new attributes which of course ran with no issues.
    I was seeing the three new fields as attributes. But when I went within the existing Perspective to add the newly added fields so that the users see them, one of the field is missing. It is just a VARCHAR field. What would it cause this field to not show up
    within a Perspective?
    Any help is greatly appreciated.Thanks,
    Nimesh
    NM

    Hi NM,
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How can I make the form fields show all inputted text?

    I am trying to create forms to collect customer data.  Currently, when I get them back from the customer, if they have typed in more words than the field box allows for, we have to scroll to read it all.  When we go to print the form, only the text that fits in the box will print.  Help!

    Your choices are:
    Make the field larger.
    Limit the number of characters that can be placed in a field.
    Export o Excel.
    Add a page with one large field with the same name as the problem field.
    Create a dynamic PDF using LiveCycle.

  • Sql developer behavior, expands table.* to show all fields?

    Am I doing something wrong, or does sql developer (10g) have an odd behavior?
    If I create a view
    select mytable.* from mytable
    it saves the view like
    select mytable.myid, mytable.mycol1, mytable.mycol2 from mytable
    IE it replaces the mytable.* with a select clause that includes every column individually. I've never seen any sql editor do anything like this.

    I have never seen a sql editor make such massive changes to whatever one entered. It's not SQL Developer doing this, it's Oracle itself.
    Here I'm not using any editor, just SQL Plus (repeating Solomon's example):
    SQL> create view emp_v as select * from emp;
    View created.
    SQL> select view_name, text from user_views;
    VIEW_NAME                      TEXT
    EMP_V                          select "EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO" from empThis is also documented (indirectly) in the SQL Reference manual under CREATE VIEW:
    "If the subquery uses an asterisk (*) to select all columns of a table, and you later add new columns to the table, then the view will not contain those columns until you re-create the view by issuing a CREATE OR REPLACE VIEW statement."
    That's because the "select *" is expanded to explicitly name all the columns when the view is created.

  • How to show a single error message for all fields

    Hi
    I have a JSF from containing around 10 controls(input, select etc.) .
    Now I need to display an error message in case any of the mandatory control has validation error.
    Message format would be like
    "*Please,Complete the fields marked with yellow!"* The message I need to show in a div tag with Yelow background.
    Currently, I am getting individual default error message in case validation fails and related field is bordered with Yellow.
    My code is below.
    *<h:panelGrid columns="3">*
    *<h:outputText value="#{msgProv.bi_firstname}" />*
    *<h:outputText>*
    *<rich:spacer width="100px"></rich:spacer>*
    *</h:outputText>*
    *<h:panelGroup>*
    *<h:inputText*
    *value="#{brokerInformationFields.firstName}"*
    *label="#{msgProv.bi_firstname}" id="firstName" required="true">*
    *<f:validateLength maximum="10" minimum="2" />*
    *<rich:ajaxValidator event="onblur" />*
    *</h:inputText>*
    *</h:panelGroup>*
    *<h:outputText value="#{msgProv.bi_lastname}" />*
    *<h:outputText>*
    *<rich:spacer width="100px"></rich:spacer>*
    *</h:outputText>*
    *<h:panelGroup>*
    *<h:inputText label="#{msgProv.bi_lastname}" id="lastName"*
    *value="#{brokerInformationFields.lastName}" required="true">*
    *<f:validateLength maximum="20" minimum="1"/>*
    *<rich:ajaxValidator event="onblur" />*
    *</h:inputText>*
    *</h:panelGroup>*
    *<h:commandLink action="#{brokerInformationActions.submit}">*
    *<h:graphicImage value="/images/axa/btn_submit_from.png" style="border:0px;"/>*
    *</h:commandLink>*
    I am using (JSF1.2,Rich Faces 3.3.0,Facelets.)
    And a Phase Listener from
    http://balusc.blogspot.com/2007/12/set-focus-in-jsf.html
    This Phase listener is to border the control with Yellow in case validation fail.
    Now my Query
    *1) How can I show a single message for all fields as I marked above in case of validation failure?*
    *2) Now, the control is becoming yellow borderd when user clicks the submit button and validation fails.*
    *User can move from one control to other using tab. That time proper validation message is appearing.*
    *but the border of the control is not changing to yellow.*
    *What's the correcion can be made to meet that requirement too.*
    regards
    Roy

    Hi Nabheet,
    Thanks for your response.
    The FM returns the error messages if they are standard ones. For example, if the posting period is closed - the FM will not allow the Workflow to proceed further.
    But in this case, I have a custom error - for a particular Profit center, Cost center and I/O fields are mandatory(not at time of parking, but should be filled before posting).
    Since this is not a standard error, this FM will not stop workflow from proceeding further. How can I have the custom error captured in this FM?
    Thanks.

  • How to show all available fields in the SQL Worksheet's Code Assist pop-up

    I have table with many fields and wanted to scroll through the fields list by typing something like:
    select a. from test a
    The Code Assist pop-up (after the 'a.') that shows the field list shows '...' as last available field before '*'. Many fields are not shown on the pop-up. I have to click on the '...' field to tell the pop-up to refresh itself with a full list of fields. Is there a way that I can configure SQL Worksheet to always show all fields on the pop-up, instead of having to select '...' on every attempt to add a field to the select SQL?

    Sure, happens to everyone ;)
    Not the case here, but often the OP gives credit to the first to respond rather than acknowledging everyone's effort and time invested, which of course is independent from posting order. Add that to the nicely conceived, but badly implemented reward point system. Should have moderators for that to work as it should. Sooo many questions remain unanswered and/or unrewarded. I even think you're the most underrated helping hand on the forum. Let's hope time will rectify all that...
    Regards,
    K.

  • In material master not all fields show the description of their value

    Gurus -
    Certain fields in the material master show their description text along.
    Example -
    Base Unit of Measure  - EA      each
    The description Text 'Each' which represent 'EA' comes from text Table T006A-MSEHT
    Not all fields in material master show the description of what they represent. (only appear on F4 popup)
    I want this description to come up for MARA-MAGRV field.
    I want the configured value description for this field to appear on the screen.
    I have 3 values put in this MARA-MAGRV
    Z001 - description text 1
    Z002 - description text 2
    Z003 - description text 3
    in MM01/MM02/MM03 only Z001 is see, not it description.
    Here is what i tried
    Added TVEGRT-BEZEI (desc field) in Transaction OMSR and assigned selection group 103 which holds MARA-MAGRV field too
    any config missing?? what say?
    Advises appreciated!
    Thanks

    You have to find out the conversion routine for domain MAGRV and enter in the convers. routine field.
    if did not find one than you have create custom (take ABAPer help)
    go to SE11 adn enter the domain MAGRV and hit display
    on the definition tab you will see the conversion routine
    here you need to populate the appo. conversion routine to see the text on the materia screen.
    Conversion takes place when converting the contents of a screen field   
    from display format to SAP-internal format and vice versa and when      
    outputting with the ABAP statement WRITE, depending on the data type of 
    the field.                                                                               
    If standard conversion is not suitable, it can be overridden by         
    specifying a conversion routine in the underlying domain.                                                                               
    A conversion routine is identified by its five-place name and is stored 
    as a group of two function modules. The function modules have a fixed   
    naming convention. The following function modules are assigned to       
    conversion routine xxxxx:                                               
    o  CONVERSION_EXIT_xxxxx_INPUT                                          
    o  CONVERSION_EXIT_xxxxx_OUTPUT                                                                               
    The INPUT module performs the conversion from display format to internal
    format. The OUTPUT module performs the conversion from internal format to
    display format.                                                                               
    If a screen field refers to a domain with a conversion routine, this    
    conversion routine is executed automatically each time an entry is made 
    in this screen field or when values are displayed with this screen field.

  • Showing all values for Multiple Line field with Append Changes

    I have a simple SharePoint list with a multiple line column that has append changes enabled. I am doing a report with Report Builder 3.0 and I want to show all values of the field the same way you achieve it through a DVWP using:<SharePoint:AppendOnlyHistory
    FieldName="Comments" runat="server"
    ControlMode="Display" ItemId="{@ID}"/>
    For reference, I'm trying to replicate this function, but on a report:
    http://sympmarc.com/2011/02/07/showing-all-versions-of-append-changes-to-existing-text-in-a-data-view-web-part-dvwp/ 
    Any suggestions to show all the appended values in a report?

    Hi Lewis75581,
    According to your description, you want to show the append changes history of a column in Reporting Services. Right?
    In Reporting Services, we don't have a feature to show the change history of a column. However, we can have workaround on SQL level. In SQL Server, we have tables: inserted table and deleted table which contains the recently inserted and deleted records.
    In this scenario, we can create a trigger in your database. Once you insert rows into the table, it will be triggered and get those inserted rows. Then insert those rows into another table. Now we can create one more dataset based on this table and display
    these inserted rows in our report. This might be the most effective workaround for your requirement. Please refer to a similar thread below:
    http://social.technet.microsoft.com/Forums/en-US/dacfb141-a976-489a-acca-789ba90e15de/ssrs-multiple-reports-with-different-parameteres-in-single-window?forum=sqlreportingservices
    Reference:
    Use the inserted and deleted Tables
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Table Maintainace generator not showing all the fields in table

    Hello,
    I generate table maintainace genrator for Z-Table and also create Tranaction code for that.
    I have 27 fields in my Z-table but when I run tranaction code for table maintanance generator it shows only 8 fields.
    I want to show all 27 fields in my tranaction code of table maintainace generator.
    How I can Achieve this?
    Please Suggest.
    Thanks,
    Amit

    Hello Ram,
    Thanks for your answer.
    I increases lenght of screen and table control and activate function group.
    But still in program PBO of screen it showing 8 fields as follows:
    CHAIN.
        FIELD ZPROJ_FIN_STATS-PSPID .
        FIELD ZPROJ_FIN_STATS-GJAHR .
        FIELD ZPROJ_FIN_STATS-MONAT .
        FIELD ZPROJ_FIN_STATS-POSID .
        FIELD ZPROJ_FIN_STATS-IS_REL .
        FIELD ZPROJ_FIN_STATS-IS_TECO .
        FIELD ZPROJ_FIN_STATS-IS_CLSD .
        FIELD ZPROJ_FIN_STATS-LEG_STATUS .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
    but Iwant total 27 field to show.
    How I can achieve this?
    Thanks,
    Amit

Maybe you are looking for

  • I can log in to my wordpress site or rather I can get into the back end of my site but I can no longer see the edit button on Firefox

    I use firefox 24 and it was working fine up until last weekend then I could no longer see the edit button on my wordpress site. The thing is that I can get into my site via the site-wp-admin url as cookies allow me to do so but once I click on visit

  • How to print Warranty (Duration) on Delivery Note using PLD

    Hi, How can I print Warranty (No. of Months) on Delivery Note using PLD. Warranty is already defined in a service template which is assigned to Item Master record. when i try to print "duration" from OCTT is shows all the duration values set in all s

  • ECatt script setting error (se06)

    Hi Guys, I have very small issue but I couldn't figure it out.  I was using ecatt script to create user but whenever I try to enter new script name it gives me this error.  (System setting does not allow changes to be made to   object ECAT Z_NEWUSER_

  • 3D Picture Axis Definition

    As I program the 3D Picture Control, my mind is always in need of the infamous XYZ Axis definition graphic with 3 Vectors definiing the axes on the display to  ease my thinking.  Does anybody have one or is there a property or soemthing that I can sh

  • Choose variable values error in BEX 7.10 Analyzer on NW2004S

    In BEX analyzer, open a query and want to change variable values (even at startup of a query), I get the following error when clicking the "select from list" button. I have the latest version/patches of sapgui 7.10 and the BEX analyzer. .NET framewor