Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Smile Unanswered: listing data having specific constraints

    Hi,

    I just want to list the data in a 8 variable column whose specifications should be first three variabe must be a character and next five variables must be numeric. For example if the column name is USER_ID and i want to list the values having the data like 'AAANNNN'(ABC12345).

    Can some one help me to sort this out?

    I used the code like

    select * from tablename where substr(USER_ID,1,3) is alpha and substr(USER_ID,4,5) is number

    but no use, these functions are not available.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    functions are not available. ??
    select * from tab where substr(col,1,1)='x' and substr(col,4,5)='x'
    for substr which is a character based function you can not specify numbers
    check the doc
    SUBSTR
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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