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
What is xml source qualifier transformation in informatica?
Give some information on report bursting and how to do it in bca as I have to split the report and send different reports to different people?
How to create the source and target database connections in server manager?
What are the transformations that are not supported in mapplet?
What are active transformations.
What is flashback table ? Advance thanks
I have three same source structure tables. But, I want to load into single target table. How do I do this? Explain in detail through mapping flow.
What all are steps in up gradation of Informatica server?
how lookup transformation is made active in new versions... When to use connected and when to use unconnected lookup and why? which is good for session performance. How to make lookup persistent and how to remove stale data from that lookup. how commit works - when we stop or abort data. Explain in both cases. What is factless fact table and have you ever used it in real time scenarios.
explain about unit testing? in real time?
expain about the tune parameters?
How can we use mapping variables in informatica? Where do we use them?
In what scenario we use to improve session performance by pushdown optimization?can any one give example?
What do you understand by SOA of Informatica?
What differs when we choose the sorted input for aggregator transformation?