You tried to execute a query that does not include the specified expression 'X' as

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saurabh678
    New Member
    • May 2013
    • 2

    #1

    You tried to execute a query that does not include the specified expression 'X' as

    im having this same problem ..

    this is my query ..
    Code:
    select title, url,sum(visit_count),microsoft from (select * from data_repository where (username='prasad'and microsoft>0 or title like '%microsoft%')) group by url ,title order by sum(visit_count) desc, microsoft desc;
    can u tell me how i can fix this problem ??

    thanks in advancee
    Last edited by Rabbit; May 1 '13, 04:54 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code. You have the field microsoft in your selection but you have not aggregated it or grouped by it. You need to do one or the other.

    Comment

    • saurabh678
      New Member
      • May 2013
      • 2

      #3
      Code:
      select title, url from (select * from data_repository where (username='daga'and java>0  or title like '%java%')) group by url ,title  order by Sum(visit_count) desc, java desc
      is this fine ?

      cause its still not working?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I don't even understand what you're trying to do there... You've made it way more complicated. Just take your original query and either group by the microsoft field or aggregate it. Which one you choose depends on what you want to do with the microsoft field.

        Comment

        Working...