Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010

    Unanswered: general grouping of instances

    Dear All,
    I have a database with only one table.
    The id is a serial number. Now I would like to group instances according to numeric paterns that I don't know in advance - for example I want to group instances having the dientical string of the certain part of a serial number - that is for example I want to group instance with the same third, fourth, fifth and seventh element in the serial number.
    What is the best practice in doinf this?

  2. #2
    Join Date
    Nov 2003
    Provided Answers: 8
    Something like
    GROUP BY substr(id::text,3,3)||substr(id::text,7,1)

Posting Permissions

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