Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2013
    Posts
    2

    Unanswered: how to "select DISTINCT" xml type data?

    Hi, All

    Suppose I have a table "my_table" which contains one column "my_col". The "my_col" is XML type.

    I tried to run following sql:

    SELECT DISTINCT my_col
    FROM my_table;
    However, it does not work. Can anyone advise me what mistake I have made? Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by littlewenwen View Post
    it does not work. Can anyone advise me what mistake I have made?
    Probably not without more detail.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Apr 2013
    Posts
    2
    Thank you. I think it is the problem related to XML data type.

    I googled online and read people say that XML type data is not compatible with DISTINCT clause and has to be converted to CHAR type. However I also read that, under DB2, XML data cannot be converted. Is this correct?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by littlewenwen View Post
    I googled online and read people say... XML data cannot be converted. Is this correct?
    May be you could try reading the DB2 manuals instead? http://pic.dhe.ibm.com/infocenter/db.../r0008478.html
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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