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

Answers were Sorted based on User's Feedback



Consider a Phone Log table as below. It records all phone numbers that we dial in a given day. ..

Answer / 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

Consider a Phone Log table as below. It records all phone numbers that we dial in a given day. ..

Answer / 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

More Informatica Interview Questions

what are testing in a mapping level please give brif eplanation

1 Answers   CTS,


i have a source table ID NAME SAL 101 A 1000 102 B 2000 103 C 1500 target load should be ID NAME SAL 101 A 1000 101 B 2000 101 C 1500 102 A 1000 102 B 2000 102 C 1500 103 A 1000 103 B 2000 103 C 1500

3 Answers   TCS,


Explain sessions. Explain how batches are used to combine executions?

0 Answers  


What is the difference between source qualifier transformations source filter to filter transformation?

0 Answers  


What all are steps in up gradation of Informatica server?

0 Answers  






without update strategy how to insert &update?

1 Answers   DELL,


What is status code in informatica?

0 Answers  


How to do Half of the table ex: if 1000 records are there means 500 in one table and 500 in second table like this if N number of tables means how to do Half of the table ??????????

2 Answers   TCS,


What is the session task and command task?

0 Answers  


Hi All can anyone tell me where i will get Informatica training in Mumbai?

3 Answers  


Tell me about MD5 functions in informatica

0 Answers  


Informatica settings are available in which file?

0 Answers   Informatica,


Categories