Find out the MIN & MAX of DATE QUARTERWISE

Hi All ,
I need to find out the MIN & MAX of DATE for QUARTEWISE by using SQL Only . How we can do it ? if anybody knows Please revert me .
Thanx in Advance
Bye

SQL> select deptno,
2  to_char(trunc(hiredate,'q'),'YYYY"Q"Q'),
3  to_char(min(hiredate),'DD.MM') MIN,
4  to_char(max(hiredate),'DD.MM') MAX
5  from emp
6  group by deptno, trunc(hiredate,'q');
    DEPTNO TO_CHA MIN   MAX
        10 1981Q2 09.06 09.06
        10 1981Q4 17.11 17.11
        10 1982Q1 23.01 23.01
        20 1980Q4 17.12 17.12
        20 1981Q2 02.04 02.04
        20 1981Q4 03.12 03.12
        20 1987Q2 19.04 23.05
        30 1981Q1 20.02 22.02
        30 1981Q2 01.05 01.05
        30 1981Q3 08.09 28.09
        30 1981Q4 03.12 03.12

Similar Messages

  • How to find out the min & max partition_id in a range partition?

    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??

    vxwo0owxv wrote:
    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??query DBA_TAB_PARTITIONS.HIGH_VALUE

  • To find out the min and max memory been used by each parameter under SGA_MA

    Hi,
    Can any please tell me how to find out the min and max memory been used by each parameter under SGA_MAX and SGA_TARGET ? below is the db CRMS65T. If any such script is there please provide me
    SQL> select name from v$database;
    NAME
    CRMS65T
    SQL> show parameter sga
    NAME                                 TYPE        VALUE
    lock_sga                             boolean     FALSE
    pre_page_sga                         boolean     FALSE
    sga_max_size                         big integer 1000M
    sga_target                           big integer 1000MThanks in advance

    Can any please tell me how to find out the min and max memory been used by each parameter under SGA_MAX and SGA_TARGET ? below is the db CRMS65T. If any such script is there please provide meI guess your question is, each memory components of SGA? if so
    SQL> select * from v$sgainfo;
    NAME                                  BYTES RES
    Fixed SGA Size                      2088504 No
    Redo Buffers                       18882560 No
    Buffer Cache Size                 616562688 Yes
    Shared Pool Size                  301989888 Yes
    Large Pool Size                     4194304 Yes
    Java Pool Size                      4194304 Yes
    Streams Pool Size                         0 Yes
    Granule Size                        4194304 No
    Maximum SGA Size                  947912704 No
    Startup overhead in Shared Pool   125829120 No
    Free SGA Memory Available                 0Also check
    SQL> select COMPONENT,CURRENT_SIZE,MIN_SIZE,MAX_SIZE,USER_SPECIFIED_SIZE from v$sga_dynamic_components;
    shared pool                                                         301989888  301989888          0           209715200
    large pool                                                            4194304    4194304          0             4194304
    java pool                                                             4194304    4194304          0             4194304
    streams pool                                                                0          0          0                   0
    DEFAULT buffer cache                                                616562688  616562688          0           603979776
    KEEP buffer cache                                                           0          0          0                   0
    RECYCLE buffer cache                                                        0          0          0                   0
    DEFAULT 2K buffer cache                                                     0          0          0                   0
    DEFAULT 4K buffer cache                                                     0          0          0                   0
    DEFAULT 8K buffer cache                                                     0          0          0                   0
    DEFAULT 16K buffer cache                                                    0          0          0                   0
    DEFAULT 32K buffer cache                                                    0          0          0                   0
    ASM Buffer Cache                                                            0          0          0           603979776
    13 rows selected.
    SQL>Edited by: CKPT on Sep 19, 2011 8:55 AM

  • Need to find out the number of Master data records transfered to the BW

    Hi,
    We need to find out the number of Master data (example -0MAT_PLANT_ATTR) records to be transfered to BW side. This is a delta extract.  We are preparing test scripts to check the master data extract ( full & delta) from ECC6 TO BI 7.0..
    Advance Thanks.

    Hi,
    Goto RSA3 and run that master data extractor in D mode if you want to know the number of records in delta and in F mode if you want to know the Full volume. But make sure that you set data records/calls and the display extr calls numbers so that you get the total number of records.
    The other option is goto the master data source table and look at the number of records in that table. That'll give you an idea of the total number of records in the table.
    One other option is to goto RSA7 , select the delta datasource and hit the display button. You'll get to know the number of entries in the delta queue that way as well.
    Cheers,
    Kedar

  • How can I find out the semester in a date?

    Hello I have this query
    SELECT 1949+rowno_year || lpad(rowno_month, 2, '0') MONTH_ID, to_char(to_date(to_char(1949+rowno_year || lpad(rowno_month, 2, '0')),'YYYYMM' ),'MONTH','NLS_DATE_LANGUAGE = ENGLISH') MONTH_NAME,
    to_char(to_date(to_char(1949+rowno_year || lpad(rowno_month, 2, '0')),'YYYYMM' ),'Q','NLS_DATE_LANGUAGE = ENGLISH') QUARTER_ID,
    FROM dual A,
    (SELECT ROWNUM rowno_year FROM DUAL CONNECT BY LEVEL <= 100) B,
    (SELECT ROWNUM rowno_month FROM DUAL CONNECT BY LEVEL <= 12) c
    How can I find out in which semester the date is?
    And the four_month_period??
    Thanks in advance

    >
    Simply I'm building a date from 1950 until 2050 in this formast (YYYYMM) then for each row I want to find out the Name of the month, the quarter, semester and half-month-period to which it belongs.
    >
    I meant an example where you display 1 or more rows and the your expected values. How am I to know how your definition of semester works, for example?
    C.

  • How to find out the Datasources  for particular data in R/3

    Hi ,
         I want to retrive the data from R/3 tables  which are  VEKP, INOB ,AUSP , CABN .. these all are ACCOUNTABILITY details...  so, how can i find the  BI  content  DataSources  are available or not...  if available means..
        for these ACCOUNTABILITY details.. i want to  know the BI content  CUBES  and ODS's  and  Datasources...  so, can any one give me the  names of  datasources.. or  cubes..  and how can we find out those names...
    helpfull answers will be highly appriciated..
    regards
    Babu

    The best way to go for this is to check the table RSOSFIELDMAP in BW.
    Put in the values below and you would see which field of R/3 maps to which info object in BW. If  nothing is mapped that means there is no infoobject mapped yet to that field. In this case you need to hunt in the BC or create your own info object.
    Soursystem = your r/3 sourssytem
    version = A
    field = your r/3 field name
    Once you get the datasource name, i am sure you can figure out the corresponding infosource and then the cubes and ODS linked to that infosource. ( right click infosource - - show dataflow)
    Hope this helps.

  • Dynamically Find out the Integer and Decimal Data Type of a Column

    Table: test (INTE number, DECI number(7,2))
    Try to dynamically determine the column type.
    Using select data_type from user_tab_columns. It only returns NUMBER which does not indicate if the column is an integer or decimal data type.
    Is there a way to dynamically determine if a column is integer or decimal type?
    Thanks

    First of all your column INTE stores not just integers but any franctional numbers too:
    SQL> create table test(INTE number, DECI number(7,2))
      2  /
    Table created.
    SQL> insert
      2    into test
      3    values(
      4           10.99,
      5           10.99
      6          )
      7  /
    1 row created.
    SQL> select  *
      2    from  test
      3  /
          INTE       DECI
         10.99      10.99
    SQL>If you want to declare column as integer you use either NUMBER(n) or INTEGER. And, as others already pointed out, you can check DATA_PRECISION & DATA_SCALE in data dictionary view USER/ALL/DBA_TAB_COLUMNS.
    SY.

  • How to find out the Release date & Release code of PO's ?

    Dear All,
    Is there any standard reports available to find out the Release date & Release codes of PO's which are already released & the PO's which are pending for release ?
    Regards,

    HI All,
    Thanks a lot for your response.
    In ME2N,ME2M etc..I have to select each single PO line item & then have to go to Header Changes to find out this info.
    So, Is it possible to find out the release codes/release date of all the PO's in a single shot?
    Hope my query is clear.
    Thanks & Regards,

  • How to find out the list of implemented OSS Notes in a particular period.

    Hi Friends,
    Need help.
    I need to find out the list of OSS Notes implemented in a period in a particular system.
    Could you please suggest the table or program or any way to find out the OSS Notes Implemented date wise?
    Thanks in Advance.
    Sreenivas

    Hi Sreenivas.
    How did you find the solution to this? Trying to do the same thing!
    Cheers,
    Tom

  • How to find out the max/min value of one field corresponding to a second field in HANA through graphical way.

    Hi,
    I am trying to find out the latest delivery date(EINDT)  for each purchasing document (EBELN) through graphical way.
    The view contains other fields apart from the above mentioned two fields.
    When only the two fields (EBELN, EINDT) are there, then in semantics, I can select 'Max' as aggregation to get the maximum value for each document.
    If I do like this, then I need to join more than 3 views and also so many joins in calculation view. Taking so much time for data preview.
    Hence , please help me in getting the solution while the view contains other fields also.
    Thanks in advance.
    Thanks,
    Jyothirmayi

    Hi Sreehari/Vinoth,
    Thank you for your replies.
    if only two fields are then I can get the max/min values of one field corresponding to other field.
    But more than two fields are there with different values, then let me know how to find out the max/min value of a particular filed corresponding to the 2nd field with other fields also should be in the output.
    I hope you understood my issue.Please revert in case of questions.
    Thanks & Regards,
    Jyothirmayi

  • Finding out the active user in last 10 min

    Hi frends,
    i have the requirement where i have to find out the the following....
    1. who r the user accssing the portal for last 10 min....
    2. what r the pages they r viewing.......
    3. do they got any time out ......
    4. in what page they got the time out........
    can anyone help me out in this regards...
    thanks in advance......
    sithi

    Hi Martin,
    my complete code is as below:
    Pls check it for correctness.
    IPortalComponentResponse response = (IPortalComponentResponse)this.getResponse();       
          Form myForm = this.getForm(); // get the form from DynPage
          int dat = 6000060600;
    IUserAccountFactory useraccfact = UMFactory.getUserAccountFactory();
    try{
      IUserAccountSearchFilter srcFilt = useraccfact.getUserAccountSearchFilter();
      Date secondDate = Calendar.getInstance().getTime();
      Date firstDate = new Date(secondDate.getTime()-dat);
      srcFilt.setLoggedInBetween(secondDate,firstDate);
      ISearchResult result = useraccfact.search(srcFilt);
      List list = new LinkedList();
      while(result.hasNext()){
      String id= (String)result.next();
      response.write("<br>hi"+id);
      list.add(id);
    Collections.sort(list);
    Iterator iter = list.iterator();
      int count = list.size();
      while(iter.hasNext()){
    IUserAccount useracc = useraccfact.getUserAccount(iter.next().toString());
    String disp = useracc.getAssignedUserID();
    response.write("<br>"+disp);
      response.write("<br> <b>No of Hits = <b>"+count );
      catch (UMException e) {
      response.write("<br>Searching failed - " + e.getLocalizedMessage());
    Regards,
    Sithi

  • Write a procedure to find out the data copy is happening or not.

    Good Day all,
    I have two databases called "*Report*" and "*Production*". I have a report database which copy a data from production database. I want to write a Stored procedure to compare the count of one table in both the databases. All the tables are same in both the databases.
    Please note :*
    1. We are writing the procedure to find out the data copy is happening or not and also report database is down or not.
    2. Not all times, the both the count is same, sometimes it take delay to copy the data in report database but report database is not down.
    Please see the query to compare
    _"Report"_
    Select count(*) from trx where date ='03-Oct-2010'
    *"Production"*
    Select count(*) from trx where date ='03-Oct-2010'
    I am suggesting to take a count for every 5 mins and keep in temp table and compare it.
    Thanks
    Nihar

    How are you replicating the data from the production database to the reporting database?
    Wouldn't it make more sense to monitor that replication process rather than counting every row in the table every 5 minutes? That's going to get rather expensive for non-trivial tables. If you are using something like Streams to replicate the data, it would make far more sense to monitor the Streams apply process, to determine when the reporting database it updated as of, than it would to monitor the underlying tables.
    Justin

  • How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    Thanks so much for your reply King_Penguin. No, sadly there is not indication of the expected release date on the film, it's no where to be found. I have also tried to look in other places online, but no luck. I guess your latter statement jives more with my situation, that  being the studio/rights-holder hasn't feel inclined to provide the date.

  • How do i find out the tables (data)effected in a schema after a particular time stamp

    how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
    pls email in [email protected]

    You can't do that. That would be a real security risc.
    /KAj

  • How do I find out the date in which I registered my imac?

    How do I find out the date in which I registered my imac?

    It doens't really matter what date you registered it. However if you are looking to see when your expiration on AppleCare is/was it is 3 years from the original date of purchase. You can use the Apple Online Service Assistant afer you input the serial number click the link that says See your service and support coverage.

Maybe you are looking for

  • Please Help - When I try to add ASM Disk to ASM Diskgroup it crashes Server

    We are using a Pillar SAN and have LUNS Created and are using the following multipath device: (I'm a DBA more then anything else... but I am rather familiar with linux .... SAN Hardware not so much) Device Size Mount Point /dev/dpda1 11G /u01 The Abo

  • How to prevent iTunes to open when my device is connected

    Hi, I'm using iTunes 10.0.1.22 on Windows Vista OS. Each time i connect my iPhone to the computer, the iTunes opens. i don't want it to happen. not to open and not to sync. There's is NO tick in iTunes > Device > Summary > Options > Open iTunes when

  • Help on iphone purchase please

    I am thinking about buying an iphone and I have been reviewing for about 2 weeks now and I have read just about every good and bad review I could find. I think that it has what I need as far as functionality especially since we don't have 3g in my ar

  • Markers on Line Chart

    Hi, Can anybody help me with adding markers (think that they are colled like that) to the Line Chart. Please refer to the attached example link Example Is there a Line Chart series option in styles to add those? Please help.

  • Lightroom 5 and NIK plug-in

    I downloaded Lightroom 5 and then purchased the package of all Nik software. When using LR5, I can only access one element, (HDR) but not the others. I have tried re-installing but nothing works. Any ideas?