Query of Queries Case expression

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Query of Queries Case expression

    Eventhough I have searched this , I can't find an answer for this
    Does queries of queries support the case function?

    like this....
    <cfquery name="gettotal" dbtype="query">
    select SUM(case when getdeals.source = 1 then 1 else 0 end)
    from getdeals
    order by getdeals.source
    </cfquery>

    thanks!



    Zig Ziglar Guest

  2. Similar Questions and Discussions

    1. Need Help with Query of Queries
      I have the query "almost" there but I'm not sure exactly how to accomplish this. I need all recrods meeting the criteria from the AppliedLicense...
    2. Query of Queries
      I think that we're using 5 on both environments (not checked that though - they shouldn't be different anyway)... It seems that i've fixed it......
    3. Query of Queries in 7.0
      I am running MX 6.1 and was wondering of the QofQ problem still exists (in the new version, 7.0) where CF tries to guess at the column datatype...
    4. Query of Queries on query New type query
      In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could...
    5. Syntax error in Query Expression,
      Hi everyone I have a page on my site in which i wish to display links to brochures, and i have stored an index of these links in my database. ...
  3. #2

    Default Re: Query of Queries Case expression

    To the best of my knowledge, Q-of-Q does not support CASE as one of its rather limited set of "internal" functions.

    Phil
    paross1 Guest

  4. #3

    Default Re: Query of Queries Case expression

    > To the best of my knowledge, Q-of-Q does not support CASE as one of its rather limited set of "internal" functions.

    That's right.

    Here's the long and the short of it (CFMX6.0, but hasn't changed, I think):

    [url]http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/using_recordsets4.htm[/url]

    --
    Adam
    Adam Cameron Guest

  5. #4

    Default Re: Query of Queries Case expression

    You can often work around this with crafty use of WHERE clauses and UNION selects.
    MikerRoo Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139