mysql - output specific columns in SQL -


i want output 2 rows - title , sum. title comes orbiting_group_types table, while sum calculating during sql query. here query output orbiting_group_types joined sum column:

select     *     orbiting_group_types ogt left join (     select         sum (val),         orbiting_group_type_id             report_orbiting_vals subrov             subrov.orbiting_group_type_id = 4     group         orbiting_group_type_id ) rov on ogt. id = rov.orbiting_group_type_id  

i want output title , sum columns. how should modify query that?

try :

select     ogt.title,     rov.summ  orbiting_group_types ogt left join (   select     sum (val) summ,     orbiting_group_type_id       report_orbiting_vals subrov       subrov.orbiting_group_type_id = 4  group     orbiting_group_type_id ) rov on ogt. id = rov.orbiting_group_type_id  

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -