Selecting Certain Number of Characters from Table -- Simple SQL Question

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Selecting Certain Number of Characters from Table -- Simple SQL Question

    How can I select a certain number of characters from a string, without
    selecting the whole string?

    For example, I want the first 50 characters of a 500 character string in my
    database. What would the SQL command to do this look like?

    Thanks,

    Ron


    Ron Guest

  2. Similar Questions and Discussions

    1. Dreamweaver recordset, selecting table
      In Dreamweaver 8, when I go to set up a recordset, in the recordset dialog box, the "table" dropdown box indicates a path to the table in the...
    2. SELECTing the 'middle' row in a table (maybe with php?)
      A table contains records of Ice Cream flavors. There is a primary id field (INT) and a varchar for flavor. I need to get the row in the very...
    3. selecting ordered groups out of a table
      Rainer Gauweiler wrote: with recent_orders as ( select customer, invoice-nr, date, row_number() over (partition by customer, order by date...
    4. Simple Number Formating Question
      Use a field of type Number, and set the Format property of the field (lower pane in table design) to: 00 Are you sure you want to do this? 03 is...
    5. Simple Regex question (~[^newline characters])
      <? // Test example: echo '<pre>'; $aInput = ' abtgh kdghg 9867 jkuhkh ^ { ooijj 438764 - 56_ 67 '; $aInput = ereg_replace('', ',' ,...
  3. #2

    Default Re: Selecting Certain Number of Characters from Table -- Simple SQL Question

    This is not the best forum for a SQL question, but I believe I have your
    answer anyway.
    Use the Left() SQL function. You could also use the SubString method.
    Here's more info:
    [url]http://www.experts-exchange.com/Developer/Databases/Microsoft_SQL_Server/Q_20639372.html[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Ron" <ron@razorvision.net> wrote in message
    news:bdq9om$7nh@library2.airnews.net...
    > How can I select a certain number of characters from a string, without
    > selecting the whole string?
    >
    > For example, I want the first 50 characters of a 500 character string in
    my
    > database. What would the SQL command to do this look like?
    >
    > Thanks,
    >
    > Ron
    >
    >

    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: Selecting Certain Number of Characters from Table -- Simple SQL Question

    Thanks for your help,

    Ron
    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:OjeyQA1PDHA.3768@tk2msftngp13.phx.gbl...
    > This is not the best forum for a SQL question, but I believe I have your
    > answer anyway.
    > Use the Left() SQL function. You could also use the SubString method.
    > Here's more info:
    >
    [url]http://www.experts-exchange.com/Developer/Databases/Microsoft_SQL_Server/Q_20639372.html[/url]
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "Ron" <ron@razorvision.net> wrote in message
    > news:bdq9om$7nh@library2.airnews.net...
    > > How can I select a certain number of characters from a string, without
    > > selecting the whole string?
    > >
    > > For example, I want the first 50 characters of a 500 character string in
    > my
    > > database. What would the SQL command to do this look like?
    > >
    > > Thanks,
    > >
    > > Ron
    > >
    > >
    >
    >

    Ron Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139