Jump to content

SQL Query Help


ranjith23

Recommended Posts

44 minutes ago, ranku_mogudu said:

uko baa.. he tried his best no..encourage these people rather than who cannot google.

@3$%

 

adokkate kadu... asalu aa result ki table create cheyyalanna idea ravadame silent_I1

Link to comment
Share on other sites

  • 6 years later...
On 5/30/2017 at 1:45 PM, ranjith23 said:

SQL Experts, Need SQL help to achieve below task:

SQL should pull only FIRST EX to BU PAY GROUP change date for each employee. If Employee don't come under this scenario, it should skip him

INPUT:

EMPLOYEE      DATE           PAY GROUP

A186                01-21-2012     EX
A186                01-22-2012     EX
A186                01-23-2012     EX
A186                01-23-2012     BU
A186                01-24-2012     EX
A186                01-24-2012     BU
A186                01-25-2012     EX

A187                01-21-2012     EX
A187                01-21-2012     EX
A187                01-21-2012     NE

A188                01-28-2012     BU
A188                01-29-2012     BU
A188                01-30-2012     BU

A189                03-18-2012     BU
A189                03-19-2012     BU
A189                03-20-2012     EX

A190                04-18-2012     EX
A190                04-18-2012     BU
A190                04-28-2012     BU

OUTPUT:

EMPLOYEE     DATE           PAY GROUP

A186                01-23-2012     BU
A190                04-18-2012     BU

Why we have to help you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...