Results 1 to 3 of 3

Thread: Select question

  1. #1
    Join Date
    Feb 2004
    Posts
    7

    Unanswered: Select question

    I am trying to select only the records from a table based on the existence of a character in one of the positions within a particular field. The field type is varchar(19). Can anyone help me with this problem.



    Thanks in Advance
    John C

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Use the substring function (substr). See the SQL Reference Vol 1.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    May 2003
    Posts
    113
    SELECT * from t where LOCATE(your_character, your_field) = your_position

    Quote Originally Posted by cartjohn
    I am trying to select only the records from a table based on the existence of a character in one of the positions within a particular field. The field type is varchar(19). Can anyone help me with this problem.



    Thanks in Advance
    John C

Posting Permissions

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