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 [...]
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 [...]
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 [...]
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 [...]





