Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2016
    Posts
    1

    Exclamation Unanswered: Find active field that is active in more than active rows

    Question: Select all Externals that are active in more than one active rows.

    Active = Row_Time > CURRENT TIMESTAMP

    Tables:

    Row_Time
    9999-12-31 23:59:59.0
    9999-12-31 23:59:59.0
    9999-12-31 23:59:59.0

    REG_XML_COL
    <Reg><Bus><External>89565652323</External></Bus></Reg>
    <Reg><Bus><External>56632323338</External></Bus></Reg>
    <Reg><Bus><External>55662323338</External></Bus></Reg>

    What I am doing wrong?

    Code:
    select xmlquery('$rxml/Reg/Bus/External' 
    passing REG_XML_COL as "rxml") 
    from STATE.CITY where ROW_TIME > CURRENT TIMESTAMP and HAVING(select COUNT (xmlquery('$cxml/Reg/Bus/External' 
    passing REG_XML_COL as "cxml")) >1 )

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    pretty sure a group by is required for a having clause.

    Other than that, you didn't tell us that you were actually having a problem. Gave us a little on your requirements, didn't tell us what results you wanted from your specified data, didn't tell us what you are getting(wrong data/syntax error/a pat on the back)

    Until we know any of that type info, there isn't much sense in us attempting to help you. Please try being a little more descriptive with your issue and what you want.
    Dave

Tags for this Thread

Posting Permissions

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