title: Select 'long' data type with formatted output using Substring or Right/Left
body: <p>My select statement returns a list of long values which cannot be used as the expression in substring.
  The values returned by my query are 9 or 10 digits long. If it is 9 digits long for example 123456789 I want the result like 0-123-456-789 else in case of 10 digits like 3123456789 I want it as 3-123-456-789.</p>
  
  <p>Is there any function like '<strong>right</strong>' or '<strong>left</strong>' which can be used similar to the <strong>substring</strong> i.e. with 3 parameters where I can mention the starting point.</p>
  
  <p>Just point me to the right direction like the name of the function or the correct way to use formatting functions in a select statement.</p>