There are the following tables.
I'd like to make a table showing the city name, temperature average, daylight average, and energy_production average, but I don't know how to write the code, so please give me some advice.
Error with this code
class ToppagesController</pre> <strong>Toppage # index that I thought about myself</strong> <pre><code><table> <tr> <th>City</th><th>Average Tempereture</th><th>Average Daylight</th><th>Average energy production</th> </tr> <% @ houses.each do | h |%> <tr> <td><% = h.city%></td> <td><% = h.average (: temperature)%></td> <td><% = h.average (: daylight)%></td> <td><% = h.average (: energy_production)%></td> </tr> <% end%> </table>
Answer # 1
It seems to be a surprisingly complicated problem.
I haven't encountered it, but I found the following countermeasure article.
Rewrite Mysql settings
Narrow down the data to be acquired
Such things are easy to hit when searching with an error sentence.
There is no point in searching with information specific to this system, so if an error occurs in any system, hit the part that seems to be displayed and use it as a keyword.
functionally dependent on columns in GROUP BY clause
Was used as a keyword.
However, with this keyword, only Mysql articles will be hit, so if you want to narrow down to rails related
railsAlso add to adjust.
- python - i want to add a condition from a list of numbers and calculate the average value
- [html, vbs] i would like to replace the function of outputting text files with vbs with html so that it can also be output from
- html - i would like to know how to list scraped data in a table tag with each statement
- html - i would like to know how to display the value of value while leaving the display of placeholder
- how to calculate 2d list and weighted average in python
- java - calculate the average value of the student information class that manages multiple students
- html - i would like to know an alternative method because the a tag and text-align cannot be used together
- html - how to calculate the total value of columns stored in db
- html - i would like to know the shortest coding path
- html - i would like to know how to get events with a date after today with rails
- i want to extract only data from the data in the csv file and calculate the average value
- html - i would like to know the reason why the arranged inline-blocks are shifted from the top in css
- i wrote a program to calculate the zodiac from the christian era in html, but it doesn't work
- html - i want to fix the size of div elements and calculate the rest automatically
- html - i would like to know why jquery slick slider cannot be implemented
- java game creation i would like to know how to calculate the total value of random numbers
- i would like to know how to put a table in the middle of an element with html css
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file