SELECT query that returns only a limited characters?

Discussion in 'Databases' started by mahmood, Oct 25, 2007.

  1. #1
    Is there a sql select query that limits the number of characters from a field?

    This is the psudecode:

    SELECT ONLY THE FIRST 50 CHARACTERS OF myField FROM myTable
     
    mahmood, Oct 25, 2007 IP
  2. N_F_S

    N_F_S Active Member

    Messages:
    2,475
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #2
    SELECT LEFT(myField, 50) FROM myTable;
     
    N_F_S, Oct 25, 2007 IP
    mahmood likes this.
  3. mbnaragund

    mbnaragund Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    SELECT substr(myfield,1,50) as result from mytable;
     
    mbnaragund, Oct 25, 2007 IP