I am Beginner in Sql, I m trying SQL Group By statement, my requirement is below.
Table Structure <br>
USerID int <br>
BrowserName nvarchar(200) <br>
BrowserVersion nvarchar <br>
LoggedOntime Time
here is my requirement. I want select the all details based on the user id along with it should Group By Browser Name. I tried the follwing query its returining. but how to use this in visual studio to Display in Gridview as Group FOr each Browser. when the user Clicks a group in gridview it should display all details of that browser.
for eg. If i click FireFox then It should shows the detail for Firfox Group with all Version, And LoggedOnTime Details for the particular user id
select
BrowserName,
LoggedOnTime,
BrowserVersion
from
BrowserSession
inner join Users on UserId = Users.UsersId
where
UserId=21
group by
BrowserName,
LoggedOnTime,
BrowserVersion
order by
BrowserName,
LoggedOnTime
If the query is
staticyou can do like this, otherwise you can useparameterson the query:Using Parameters: