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


Please Help Members By Posting Answers For Below Questions

what is song in infrmatica...?

1678


What are the new features of informatica 9.x at the developer level?

604


What is transformation?

659


How can we improve session performance in aggregator transformation?

674


What are the transformations that cannot be placed between the sort origin and the joiner transformation so that we do not lose the input sort order?

793






What is a code page?

716


Explain the scenario which compels informatica server to reject files?

657


Different qualification between a related rotate toward the sky and isolates look upward?

556


How to elaborate tracing level?

687


what are 3 tech challenges/ common issues you face?

1891


What is resilience time?

655


How are the sources and targets definitions imported in informatica designer?

670


what is the end to end process meaning in my project(my project is development)and functionality plz tell me

1502


can we override a native sql query within informatica? Where do we do it? How do we do it?

597


Explain what is informatica metadata and where is it stored?

610