Oracle 'printf' equivalent

前端 未结 5 1544
时光说笑
时光说笑 2021-01-04 07:31

Is there an equivalent or alternative to the following?

SELECT mix_type || \' (\' || mix_num || \')\' as description
  FROM acid_batch
 WHERE mix_num < 10         


        
5条回答
  •  心在旅途
    2021-01-04 08:09

    You can resolve it in the select.

    SELECT mix_type || '(' ||  mix_num || ')' as description,
    FROM acid_batch
    WHERE mix_num < 10
    

    you should also take a look at the functions

    to_char

    to_date

    to_number

    as they give your a finer granularity on how you want the things represented.

提交回复
热议问题