Sequence within SQL Select

后端 未结 3 1027
旧时难觅i
旧时难觅i 2021-02-15 15:51

I\'m having a bit of a problem with using my sequence within a SELECT statement.

SELECT
     c.cust_name,
     c.site,
     customer_id_seq.nextval         


        
3条回答
  •  失恋的感觉
    2021-02-15 16:25

    for IBM Imformix

    In a SELECT statement, you cannot specify NEXTVAL or CURRVAL in the following contexts:

    • In the projection list when the DISTINCT keyword is used
    • In the WHERE, GROUP BY, or ORDER BY clauses
    • In a subquery
    • When the UNION operator combines SELECT statements

提交回复
热议问题