count - nested sql queries with case statement -
I am trying to use the results of a subquery as a derived table for the external query, since then Calculates and gives information to the group. Subkey This is a section of my SQL, and despite seeing me several examples online, luck does not get the right of syntax. This subkey is: select rname.rn_country as country, in the form of rname.rn_index id, yoga (rresults.rr_sec_total) time-rname intermediate rresults rresults When joining rname.rn_index = rresults.rr_rn_index where rn_view = 'right' and rr_date = '6/6 / 2012' and (rr_slide = 'standard' or rr_slide = 'water') group by rn_index, rn_country sum (rresults .rr_sec_total) & gt; = 18000 This is the result of: I need to do the ID where (what time and gt is counting the number; = 18000 and time = 36000) bronze, (time> = 36000 And & lt; = 54000) is silver, and time & gt; More than 54000 gold is classified by country. Therefore, based on the results of the above values, the...