1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

fastest query

Discussion in 'SQL PL/SQL' started by harsh 288, Sep 11, 2014.

  1. harsh 288

    harsh 288 Guest

    Hello guys,

    I'm new to this forum as well as in oracle.
    I need a query which gives a count of production lets say
    product sales count from max date in single row.

    eg.
    Total Date
    100 11-09-2014

    this query should be fastest.
    please also help me to understand which one is fastest
    Whether rank, dense rank , joins and so on.
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    The fastest query is the one you never run.


    The query you asked US to write is a basic group by query, no analytics needed. You provided no details as to table description, number of rows, create table scripts or sample data. Without that information it's impossible to tell you which of the many possible queries is 'fastest'. Also, we won't write it for you. Post what you have written, as well as the additional information mentioned above and we'll help you fix it.
     
  3. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    The general evolution of SQL programming ability among newbies is:

    Stage 1 -- Write SQL statements.
    Stage 2 -- Write SQL statements that don't generate an error.
    Stage 3 -- Write SQL statements that don't generate an error and return the correct data.
    Stage 4 -- Write SQL statements that don't generate an error, return the correct data, and perform well.

    You're trying to skip several steps. The people on this (and most) forums will help you with any of the steps from 2 through 4. However, it's your job to do the stage 1 work at the very least.
     
  4. venkateshguru

    venkateshguru Active Member

    Messages:
    30
    Likes Received:
    1
    Trophy Points:
    110
    Hi Harsh,

    Please provide the table desc and number of records. post the query what you have written. There are many ways available to group the data.


    Thanks ,
    Venkatesh.G