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 / kivi
first value and last value...
for more info ref
http://etltechsolutions.wordpress.com/2014/10/12/last_value-and-first_value-best-example/
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a surrogate key?
Implementation methodology
What are the different components of powercenter?
Explain the types of lookup transformation?
Suppose we have two source qualifier transformations sq1 and sq2 connected to target tables tgt1 and tgt2 respectively. How do you ensure tgt2 is loaded after tgt1?
What is domain in terms of informatica?
How to update source definition?
where to store informatica rejected data? How to extract the informatica rejected data?
What is depict expression change?
How you prepared reports for OLAP?
Explain what transformation and how many are there in informatica?
What is the difference between a repository server and a powerhouse?
What is incremental aggregation?
Explain sql transformation in script mode examples in informatica
What are different types of transformations available in informatica?