Consider a Phone Log table as below. It records all phone numbers that we dial in a given day.
SOURCE_PHONE_NUMBER
DESTINATION_PHONE_NUMBER
CALL_START_DATETIME
1234
4567
01/07/2011 10:00
1234
2345
01/07/2011 11:00
1234
3456
01/07/2011 12:00
1234
3456
01/07/2011 13:00
1234
4567
01/07/2011 15:00
1222
7890
01/07/2011 10:00
1222
7680
01/07/2011 12:00
1222
2345
01/07/2011 13:00
Please provide an SQL query to display the source_phone_number and a flag where the flag needs to be set to Y if first called number and last called number are the same and N if the first called number and last called number are different.
Desired Output:
Source Number
Is_Match
1222
N
1234
Y
Answer Posted / jd
this can be done using FIRST_VALUE() AND LAST_VALUE()
check the below link for more information
http://netezzamigration.blogspot.com/2014/10/lastvalue-and-firstvalue-best-example.html
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Design time, run time. If you don't create parameter what will happen
i have a data in my source as a flat files what test i have to perform the next step can any body help to me
How can repository reports be accessed without sql or other transformations?
Explain sessions?
3.how will u get information about bugs how will u rectify the bugs in realtime whch tool we are using to rectify the bugs
What are the different versions of informatica?
What is informatica? Why do we need it?
tell me the rules and responsblites in our project(my project is development)
Can we override a native sql query within informatica?
Where are the source flat files kept before running the session?
Can one use mapping parameter or variables created in one mapping into any other reusable transformation?
What is powercenter on grid?
How does the aggregator transformation handle null values?
How can we handle two sessions in informatica?
Is it possible to define a single node as a Gateway node as well as worker node?