Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15919

MySQL Query Help

$
0
0
I am looking for the correct syntax for a MySQL query. I need to select all the duration times from each unique user name.

SELECT username, durationtime FROM mcc3dumdb.tbleusage WHERE???

I know the basics of MySQL but advanced queries throw me as I dont use it often. I can take the query above (minus the WHERE), and return all entries, create the data adapter, and fill the data table. And then bind the table to a data grid view. I just need help figuring out the best way to get the average duration for each user.

In the attached image, imagine all the start, end, and duration times were different. I would like to: For Each User get all the durations. eg. all duration for jsmith, all durations, for jappleseed, etc.

I will eventually calculate the average duration for each user and in a data grid view display the user name once and the average duration. Only two columns in the DGV. If this is easier done as another table in MySQL I open to that as well but would need a little guidance on how to set that up.

I hope I explained that well. Thank you in advance.

Name:  MySQL_Example.jpg
Views: 43
Size:  57.3 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 15919

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>