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 dimensional table?
can i any one explain me realtime healthcare project explanation..for interview .iam new to informatica .thanks in advance.
Can anyone tell me the new features in Informatica 9 Version?
1)you have multiple source system where u receive files ,how do you actually load into mapping using transformation,what are the transformation you use? 2)you have files in ftp location ,how do you get it into mapping with you ETL concept?
Explain where to store informatica rejected data? How to extract the informatica rejected data?
Please let me know how to make Data masking in informatica..
HOW TO PROCESS THE ROWS FROM JOINER AND EXPRESSION TRANSFORAMTION TO SORTER TRANSFORMATION
What does reusable transformation mean?
What is a rank transform?
hi real timers . iam waiting for ur reply regarding ETL TESTING
What is the difference between Active and Passive transformation?
Write the unconnected lookup syntax?
Separate from a database, an information bazaar, and an information stockroom?
What is rank index in rank transformation?
Differentiate between reusable transformation and mapplet.