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
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 |
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 |
Why you use repository connectivity?
How do you update the records with or without using update strategy?
Source Qualifier is an active t/r but there is no change of row count then y should we called it active t/r & Router , sorter some times no change in row count then Y we called its active t/r?
Hi, I saw one mapping implemented by my seniors . In Expression transformation they implemented following logic. That is iif(is_date(in_UC_DATINV,'YYYYMMDD'),to_date(in_UC_DATINV,'Y YYYMMDD'),'Inventory Date is either invalid or null') Inventory_Date is validated only for is_date() But not validated for notisnull() . But error says “ either invalid or null “ why? Whether is_date() also check for not isnull() ? or in this logic something is different ? Please answer me . Advance thanks
By using joiner t/r we can join only 2 tables, SO if want join more than 2 flat files ,How can i join?
Explain the difference between a data warehouse and a data mart?
update strategy transformation in informatica
What is the difference between view and materialised view?
Hi Experts, Performance Wise Which transformation is better in LOOKUP AND JOINER TRansformations? Why? Can anybody please explain it ? Please help me out from this Question. Thanks In Advance.
What are the transformations that are not supported in mapplet?
From where we can start or use pmcmd?
Hi, Can someone send me the DWH and Informatica FAQ's at vanibv6@gmail.com Thanks in Advance, Vani