sql sequence 
Author Message
 sql sequence

Can you help me with creating SQL sequence, please.
I have two tables with the same format: VA and VC.

View of VA table
      ACNO
     MVAM
     DORC
     NRTD
     FUND
     DTP1

      4000270001
     600
     0
     P0202270129OP91
     P0202270129OP91
     .

      4000270001
     600
     0
     P0202270124OP91
     P0202270124OP91
     .

      4000270001
     133402
     1
     P0202270545IN00
     P0202270545IN00
     COMMENT3

View of VC table
      ACNO
     MVAM
     DORC
     NRTD
     FUND
     DTP1

      4000270001
     600
     0
     P0202270129OP91
     P0202270129OP91
     comment1

      4000270001
     600
     0
     P0202270124OP91
     P0202270124OP91
     comment2

      4000270001
     133402
     1
     P0202270545IN00
     P0202270545IN00
     .

Difference beetwen VA and VC is field DTP1. I need to link these two tables into one
by moving missing DTP1 into second. Fields ACNO,MVAM,DORC,NRTRD,FUND are the same in each table (VA and VC). I can link records by FUND field.

I would like to get result as table like following one:

      ACNO
     MVAM
     DORC
     NRTD
     FUND
     DTP1

      4000270001
     600
     0
     P0202270129OP91
     P0202270129OP91
     comment1

      4000270001
     600
     0
     P0202270124OP91
     P0202270124OP91
     comment2

      4000270001
     133402
     1
     P0202270545IN00
     P0202270545IN00
     COMMENT3

thank you a lot

--
Rafa?



Mon, 16 Aug 2004 19:20:14 GMT
 sql sequence

I supose ',' means NULL?

SELECT VA.ACNO, VA.MVAM, VA.DORC, VA.NRTD, Va.FUND,
CASE WHEN VA.DTP1 IS NOT NULL THEN VA.DTP1 ELSE VC.DTP1
FROM VA, VC WHERE VA.ACNO = VC.ACNO AND .....

Cheers
Serge
--
Serge Rielau
DB2 UDB SQL Compiler Development
IBM Software Lab, Canada



Mon, 16 Aug 2004 23:17:24 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. ORACLE-SQL : Sequence Problem (Need SQL GURUS)

2. SQL Sequence Counter in Local InterBase?

3. Retrieving Data from SQL Sequence using Visual Cafe 2.5

4. PL/SQL sequence Help Please !

5. Exploring sequences (sequence context within a tran saction)

6. Exploring sequences (sequence context within a tran

7. Exploring sequences (sequence context within a

8. Exploring sequences (sequence context within a transaction)

9. Exploring sequences (sequence context within a transaction)

10. Implementing sequences without sequences

11. Question regarding single sequence vs multiple sequences for surrogate key population

12. Question regarding single sequence vs multiple sequences for surrogate key population


 
Powered by phpBB® Forum Software