Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DB2 :: RE: SQL query to run through list of values in table

$
0
0
Author: Ni3-db2
Posted: Thu Dec 15, 2016 5:48 pm (GMT 5.5)

One more try to explian req.

Table 1
ID TIME MERCHANT
ABC 12:00 1
ABC 13:00 1

Table 2
Code Merchant
A 1
B1 1
C1 1


Output
ABC 12:00 A
ABC 13:00 A



IF CODE IS NOT ONE OF THE VALID CODE (A,B,C,D)

That is if the table 2 is as below

Table 2
Code Merchant
A1 1
B1 1
C1 1

Output
ABC 12:00 X
ABC 13:00 X

Code:

_________________
Nitin gandhi


Viewing all articles
Browse latest Browse all 9405

Trending Articles