Skip to main content
Question

Projection with a "WITH" sql clause!

  • April 7, 2021
  • 1 reply
  • 3 views

CairoKolton

Hi Experts!
Is is possible to create a projection with a WITH clause of sql?
something like this:
CREATE PROJECTION Orders_with_regtime AShttps://omegle.onl/
(WITH
registered as (
select min(time) as first_order_time,OrderId from orders group by OrderId),
orders as
(select OrderId,time,C,D,E,F,G,H,I,J from orders)
select orders.OrderId,time,C,D,E,F,G,H,I,J,registered.first_order_time
from registered,orders where
registered.OrderId=orders.OrderId order by registered.first_order_time desc

1 reply

mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • April 7, 2021

No, subqueries not allowed in projection definition, but you can reference UDTFs that are developed in C++.
See: https://www.vertica.com/docs/10.1.x/HTML/Content/Authoring/AnalyzingData/AggregatedData/UDTSupport.htm