I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4
ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000
DATE-- COLUMN. I WANT TO DISPLAY THE DATA PREVIOUS MONTH
HIGEST SAL ?

Answers were Sorted based on User's Feedback



I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4 ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000..

Answer / subhash

Select MAX(SAL) FROM EMP
where to_char(Date,'MM-YYYY')=to_char(sysdate-1,'MM-YYYY')

Is This Answer Correct ?    1 Yes 1 No

I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4 ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000..

Answer / indu

select max(sal) from emp where to_char(Date,'MM-YYYY')
=to_char(dateadd(month, -1, GETDATE()),'MM-YYYY');

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

1)i put Pharma Project in my Resume..whar are the sources used in my project Generally? 2)how many fact and dimensional tables used? 3)Have u used any Datamarts and measues in fact table? ....plz give the answers...

2 Answers   iGate,


Why do you need stage variables?

0 Answers  


What steps should be taken to improve Datastage jobs?

0 Answers  


Have you used Unstructured data?

0 Answers   CTS,


What is job control?

0 Answers  






create a job to get the previous row salary for the current row.if there is no previous row exists for the current row,then the previous row salary should be displayed as null? empid   salary   previoussalary 10      1000     null 20      2000     1000 30      3000     2000       40      4000     3000

5 Answers   Genpact,


What are the types of containers and how to create them?

0 Answers  


count number of deptno in a emp table?

2 Answers   IBM,


how can i abort the job if i get more than 100 errors in job log?

6 Answers   Accenture,


Hi, Please tell me how to solve this scenario in datastage ? Here we have 3 columns in a table TEST CODE,ENTRY DATE and BATCH The table looks like CODE ENTRYDATE BATCH 100 100716 1 100 100716 1 100 100716 1 200 122517 2 200 122517 2 302 555555 8 302 555555 8 302 555555 8 We need to create a seqno on grouping these 3 columns. The result should be like this. CODE ENTRYDATE BATCH SEQNO 100 100716 1 1 100 100716 1 2 100 100716 1 3 200 122517 2 1 200 122517 2 2 302 555555 8 1 302 555555 8 2 302 555555 8 3

1 Answers   Alpharithm Technologies,


i WANTED TO USE THE RANGE LOOKUP SCENARIO IN DATASTAGE 7.5.2 SRVER JOB.i HAVE A DATE FIELD IN SOURCE AND I SHOULD MATCH IT WITH A FIELD IN LOOKUP FILE.BUT,THE FIELDS SHOULD MATCH EVEN THOUGH THERE IS SOME RANGE.CAN SOMEONE TELL ME HOW CAN I DO THAT. THANKS

0 Answers  


What is the difference between validate and compile?

1 Answers   CTS,


Categories