drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjiv Kumar <ktrsan...@gmail.com>
Subject Pivot in Apache Drill
Date Mon, 13 Jun 2016 11:36:03 GMT
Does Apache Drill Supports Sql Pivot.

I have this:-
SQL QUERY for Creating TABLE is:-

`create table Attribute (ID int ,Name varchar(250))`.

INSERT QUERY is:-

`insert into Attribute values(1, 'Description'),
                                      (2, 'StockNumber'),
                                      (3, 'Price'),
                                      (4, 'Logo'),
                                      (5, 'Diagram');`

I want show row data (i.e:- Description, StockNumber, Price, Logo, Diagram)
as column.

I have this sql pivot query:-

`select *
from
(
  select id,name
  from Attribute
) d
pivot
(
max(id)
  for name in ([Description],[StockNumber],[Price],[Logo],[Diagram]
) piv;`


How to convert this sql query in apache drill.?

OR Is There any other solution for that.?


 ......................
  Thanks & Regards

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message