开发者

Invalid oracle view column

开发者 https://www.devze.com 2023-03-13 15:14 出处:网络
I am creating a view and one of my field in the view is PO field ( it is a primary key of output table)

I am creating a view and one of my field in the view is PO field ( it is a primary key of output table)

In output table primary key is composite key ( Id+ cntrid)

i was writing the following statement to get unique key

select  (po_cntr || proj_id) PO

but it is still开发者_如何学编程 showing dup, what is missing here?


Sounds like the concatenated values are not unique.

For instance if you have two rows like this:

PO_CNTR    PO_ID
ABC12      1
ABC1       21

Then the concatenated value for both would be 'ABC121'.

The most likely easiest solution is to include a delimiter in the concatenated field:

select  (po_cntr || '-' || proj_id) PO
0

精彩评论

暂无评论...
验证码 换一张
取 消