Learn about Lockerz... watch videos,answer dailies and earn prizes.. Invitations Sent Out: 60 >> << | Next Tip »Home

Identifying Positions based on divisions – SQL.

OkAvarageGoodVery GoodExcellent (2 votes, average: 4.50 out of 5)
Loading ... Loading ...

This query has been shared by a reader of my blog Kaushik Ghosh. It helps us to identify position and parent position for the specified division.

Can be really helpful in

  • Support jobs involving creation of various positions.
  • Avoid duplicate of Position creation
  • Places where lot of divisions and positions exsist

Here is the query

SELECT X.NAME “Division”, A.NAME “POSITION”, A.ROW_ID, C.ROW_ID, C.NAME “PARENT POSITION” FROM

S_POSTN A, S_PARTY B, S_POSTN C, S_ORG_EXT X

WHERE X.NAME = ‘LSCA France’ AND C.ROW_ID (+) = B.PAR_PARTY_ID AND A.PAR_ROW_ID = B.ROW_ID

AND A.OU_ID = X.ROW_ID
In this query you can change the condition to X.NAME LIKE ‘L%’ which will return search for all the divisions starting with ‘L’.

Thanks Kaushik for sharing it with all. Keep them coming :)

Related Posts


Article by neel

Authors bio is coming up shortly. neel tagged this post with: Read 416 articles by neel
View Comments Post a Comment
  1. Svetj says:

    Very usefull query!
    Thank You!

blog comments powered by Disqus

Polls

Do you know how to use replace function?

View Results

Loading ... Loading ...