sql - Alias case statement -


i have stored procedure return negative number in id. (on purpose). in additional, have view shows table (simple select), don't want '-' appear in id column, mean, if number negative - want add letter 'a' id without '-'.

how can this?

select replace (id, '-', 'a') myid 

or if wanting append 'a'

select replace (id, '-', '') + 'a' myid 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -