Search found 4 matches

by rthacker02
Fri Nov 07, 2014 6:35 pm
Forum: Vertica "How to..."
Topic: Crosstab or Pivot in Native Vertica SQL
Replies: 5
Views: 23943

Re: Crosstab or Pivot in Native Vertica SQL

This worked nicely. Thanks.
by rthacker02
Fri Nov 07, 2014 4:49 pm
Forum: Vertica "How to..."
Topic: Crosstab or Pivot in Native Vertica SQL
Replies: 5
Views: 23943

Re: Crosstab or Pivot in Native Vertica SQL

I found a snippet of code using NVL and DECODE and have modified it to the following: SELECT DISTINCT vdm.Market, vdm.DMID, Trim(vdm.LastName)||', '||Trim(vdm.FirstName) as DM_Name, ( SELECT MAX(DECODE(rn, 1, division)) || NVL(MAX(DECODE(rn, 2, ' & ' || division)), '') || NVL(MAX(DECODE(rn, 3, ' & '...
by rthacker02
Fri Nov 07, 2014 4:47 pm
Forum: Vertica "How to..."
Topic: Crosstab or Pivot in Native Vertica SQL
Replies: 5
Views: 23943

Re: Crosstab or Pivot in Native Vertica SQL

Thanks Jim but the sample data is just a subset of a much larger set that changes dynamically over time. I'll have to go with a more robust solution.
by rthacker02
Fri Nov 07, 2014 3:43 pm
Forum: Vertica "How to..."
Topic: Crosstab or Pivot in Native Vertica SQL
Replies: 5
Views: 23943

Crosstab or Pivot in Native Vertica SQL

I have a table as follows: Market Division DMID DM_Name Frontier WI 4486 John Frontier IDMT 2462 David Frontier NV 2462 David Frontier NDSD 5326 Debbie Frontier IA 5526 Mike Frontier NE 5526 Mike I need a query to produce this information in the following format: Market Divisions DMID DM_Name Fronti...

Go to advanced search