Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Adhoc SQL request - forum topic by bikky6

$
0
0

3 RepliesLatest reply: Jul 17, 2013 1:44 PM by KVB

<:header class=js-original-header>

Adhoc sql request


KVB Jul 17, 2013 11:11 AM <:section class=j-original-message>

Currently Being Moderated

Hi
 
I have a requirement like
 
CREATE TABLE DX(LEVEL0 CHAR(1),LEVEL1 CHAR(1),LEVEL2 CHAR(1),LEVEL3 CHAR(1));

SEL * FROM DX

INSERT INTO DX VALUES('A','A',NULL,NULL);
INSERT INTO DX VALUES('B',NULL,NULL,NULL);
INSERT INTO DX VALUES('C','C','C',NULL);
INSERT INTO DX VALUES('D',NULL,NULL,NULL);
INSERT INTO DX VALUES('E','E',NULL,NULL);
INSERT INTO DX VALUES('F','F','F','F');
 
 
LEVEL0 LEVEL1 LEVEL2 LEVEL3
A A ? ?
B ? ? ?
C C C ?
D ? ? ?
E E ? ?
F F F F
     data indicates the jobname.If you observe,it is active only to the particular level.I need my output in such a way that it should give the jobname of the maxlevel for each job.
My output should like
 
 

LEVEL0

LEVEL1

LEVEL2

LEVEL3

B

A

C

F

D

E

 

 

 

 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>