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.

    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

    Likes Received:
    Trophy Points:
    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

    Likes Received:
    Trophy Points:
    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

    Likes Received:
    Trophy Points:
    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 ,