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

    idontknowthis20 pointsBadges:
  • 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       ...

    Iamjeannie30 pointsBadges:
  • 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 it does sorting it hangs.But I need to do the...

    Mingley5 pointsBadges:
  • 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 multiple columns. Table StuNum – SchNum – Tchnum – d1...

    Ben Pinto5 pointsBadges:
1

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following