Home > Enterprise >  remove '-' in front of some returned lines in query results
remove '-' in front of some returned lines in query results

Time:10-23

COALESCE( dim_Study_Type.classical_intelerad_study_description, '' ) AS Classical_Intelerad_Study_Description,

Here is some of the results I get:

-CT HEAD WO
CHEST SINGLE VIEW
-XR CHEST
CT ANGIOGRAPHY 
-CTA HEAD

How do I trim or remove the '-' when they exist?

CodePudding user response:

If it is the starting char, you can use ltrim

select ltrim(COALESCE( dim_Study_Type.classical_intelerad_study_description, '' ),'-')

ex:

select ltrim('-ab-cd-', '-');
 ltrim
--------
 ab-cd-
(1 row)
  • Related