Author |
Topic |
vsmeruga
Starting Member
3 Posts |
Posted - 2014-12-16 : 00:47:49
|
Hi gurus I need help to write a sql statement to retrieve column headers and rows from 2 different tables. eg: row1: EMP column list, tag: emprow2: DEPT column list, tag: Deptrow3: EMP columns datarow4: DEPT columns data and the data sorted by deptno columnEg:EMP, Deptno, empno, ename, age, ...,DEPT, Deptno, ename, locEMP, 10, 7548, Justin, 43,....DEPT, 10, marketing, californiaEMP, 20, 7345, Carol,26,....DEPT, 20, finance, New YorkEMP, ....DEPT,.............. your our help on this is much appreciated. Thanks |
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2014-12-16 : 10:19:14
|
What do you mean?FROM TABLE1row1: EMP column list, tag: emp row2: DEPT column list, tag: DeptFROM TABLE2row3: EMP columns datarow4: DEPT columns data4 columns? or a merged 2 column return.We are the creators of our own reality! |
|
|
vsmeruga
Starting Member
3 Posts |
Posted - 2014-12-17 : 11:48:58
|
Data,Tablename,ColumsList:eg: 10 rows shown below and ordered based on Acct_number--------------------------------------Row1,CASH,ACCT_NUMBER,AMOUNT,DEBIT_CREDIT_FLAG,ENTITY,BUSINESS_DATE,CURRENCY,REFERENCE,TRADE_TYPE,SUB ACC CODERow2,BALANCE,ACCT_NUMBER,OPENING_BALANCE,CLOSING_BALANCE,CLOSING_BAL_DEBIT_CREDIT_FLAG,BUSINESS_DATE,CURRENCYRow3,CASH,10,500,CR,ABC,12/12/2014,USD,INTL,,US05Row4,CASH,10,1000,DR,DEF,12/12/2014,USD,DOM,,US07Row5,CASH,10,75,DR,XYZ,12/12/2014,USD,DOM,,US05Row6,BALANCE,10,500,750,DR,12/12/2014,USDRow7,CASH,20,500,CR,ABC,12/12/2014,USD,INTL,,US05Row8,CASH,20,1000,DR,DEF,12/12/2014,USD,DOM,,US07Row9,CASH,20,75,DR,XYZ,12/12/2014,USD,DOM,,US05Row10,BALANCE,20,500,750,DR,12/12/2014,USD Thanks |
|
|
vsmeruga
Starting Member
3 Posts |
Posted - 2014-12-17 : 11:49:42
|
Cash and balance tables does not have same number of fields |
|
|
|
|
|