Skip to main content

It also cannot add unique ID number as a column the table which i have created before.

question1. is there another way to create uniqueID for each row?

imagequestion 2. how can i fix this error?

 

image 

 

A hash function will be great, but unfortunately there is not in PQL.

 

Depending your case, you can generate the hash in Data Integration, adding the value as a column in your table --> HASH is supported Vertica Function

https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Mathematical/HASH.htm?Highlight=HASH

 

 

 


Hi @harun.yenia 

 

maybe the UNIQUE_ID function could help you. It returns a unique integer number for each unique input tuple. That means that if you provide the primary key column(s) of your table as input to the UNIQUE_ID function, every row will have its distinct integer ID. if you don't have a primary key in your table, you can also use INDEX_ORDER on any column that does not contain any null values; or simply use INDEX_ORDER( ISNULL( <an arbitrary column from your table> ) ). This will also return integer IDs, and each integer ID will only occur once in the column.

 

Regarding the second question: The error occurs because you cannot join the result of GENERATE_RANGE with anything else. GENERATE_RANGE only makes sense to use to populate a dropdown component with integer or date values; it cannot be used to augment other tables.

 

 

Best,

David


Reply