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

Thread: stored proc help

Threaded View

  1. #3
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    Create table statements and insert statements will help immensely.

    check if thid sql does what you want play with it then you can wrap it in a stored proc

    Code:
    select
    e.tier_id,
    e.salary,
    e.dept_id
    from(
    select 
    e.dept_id,
    e,tier_id,
    e.salary,
    rank() over(partition by e.dept_id,e.tier_id) rank
    from employee e
    where dept_id=1) t
    where rank=2
    from t
    i have a hunch your questions is ambiguous.

    even with the formatting your question is not legible i am afraid
    Last edited by hrishy; 10-01-2009 at 03:40 AM.

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