GROUP BY statement Questions

1

SQL Group by Query with aggregate function as well as detail information
Given a simple table with historical info about Hotelroom occupancies such as name of the guest, date in, type of room, number of nights, … I want to make a query resulting in 1 output record that shows the highest number of nights someone has ever stayed in the hotel, as well as the corresponding [...]

Answer Question   |  October 8, 2012  11:13 AM
Access, GROUP BY statement, MAX, Query
asked by:
20 pts.

Keep the “first” value using groupby – MYSQL
Input : col1 col2 a      1 b       1 c        2 d       2 I would like to : Create the new colX to get the first value in col1 group by col2 and save the value in colX   results : col1 col2   colX a      1       a b       1      a c        2      c d       2       c [...]

Answer Question   |  October 15, 2010  7:51 PM
GROUP BY statement, MySQL, MySQL Database, MySQL functions
asked by:
30 pts.

Query performance and tuning
Hi, I wanted know as to what I can do to my query so that it improves in performance.RIght now it it taking 3-4 hrs because of the large no of records in the DB.If i remove the group by and order by clause for the same no of records it is fast but when [...]

Answer Question   |  December 29, 2008  9:34 AM
GROUP BY statement, ORDER BY statement, Query optimization, Query performance, SQL, SQL development, SQL performance, SQL queries, SQL statements
asked by:
5 pts.

Count several columns Group by accounts Greater than value Beginner
I need to be able to count how many values are greater than 1 for each StuNum. I have only been able to count how many values are greater than 1 for each StuNum for d1 or for d2 or for d3, but not for d1, d2 and d3. How can I have it count [...]

Answer Question   |  April 18, 2008  10:58 PM
COUNT, GROUP BY statement, SQL
asked by:
5 pts.

1