Results 1 to 4 of 4

Thread: emp salary

  1. #1
    Join Date
    Aug 2007
    Posts
    4

    emp salary

    Hi,Im trying to get Min salary of an emp.. from average income on basis of dates he gets his salary , the below query works can any one help to simplify this query ...

    please find query below..!





    SELECT MIN(MONTHLY_SAL) AVERAGE_INCOME FROM (SELECT SUM(TXN_AMT) MONTHLY_SAL,A AS DATES FROM (SELECT TXN_AMT,(CAST(MONTH(TXN_DT) AS CHAR(2)) CONCAT'/' CONCAT CAST(YEAR(TXN_DT) AS CHAR(4))) AS A FROM GTDFCIA.CUST_SALARY_TXN WHERE APPLICATION_ID = 'M2007080114384938200' AND CIN='011311415') TEMP GROUP BY A) TEMP1

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Do you have table schema? On which rdbms?

  3. #3
    Join Date
    Aug 2007
    Posts
    4
    Schema name : GTDFCIA

    we are useing DB2 on Mainframes

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Table schema is columns and their data type in the table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •