mysql - Query works in SQL Fiddle but not on local DB -


i have sql fiddle here: http://sqlfiddle.com/#!9/cb017b/2

this works fine , returns expected data in sql fiddle when running query on local db following error:

#1055 - expression #2 of select list not in group clause , contains nonaggregated column 'x.var_value' not functionally dependent on columns in group clause; incompatible sql_mode=only_full_group_by

i trying group by text column named var_name, not seem work on local db.

try this:

select x.* (         select           var_name, var_value                   subscribers_vars                   subscriber = 35         order created desc       ) x       group x.var_name 

can take out order by it's hard use in sub select subsequent group by. that's show. whole query can re-written without sub select (if not exercise)

        select           var_name, var_value                   subscribers_vars                   subscriber = 35       group var_name 

Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -