DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: select salary > 2500

  1. #1
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    hi!
    i want to select the salary of all employees whoz salary is greater than 2500.
    We should not use WHERE CLAUSE and GROUP BY functions.

    got 2 use DECODE to fetch the values

    any 've the answer for this?

    jegan
    Cheers!
    OraKid.

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Why have you opened a new forum thread for the same question you've asked (and have been given an answer) yesterday? And what is the purpose of this question - is it only a puzzle? If not, what is stopping you from using a simple WHERE clause?

    Also, you should explain very precisely what you want as a result when you ask such a question.

    You said you want to "select the salary of all employees whoz salary is greater than 2500". So we should guess again what did you have in mind:

    a) one record with the summed amount of salaries > 2500
    or
    b) one record per each employee whose salary is above 2500, but for the others you don't want to display records at all.

    The ansver to a) is quite simple, you ned to use a DECODE and SUM().
    The answer to b) is also quite simple: you can't do this without a WHERE clause or HAVING clause. If you select from table without specifying a WHERE condition, you'll always get all the rows contained in that table. No exception to this rule.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width