Skip to content

SQL DATEPART(qq, @date) date quarter start October

I have a query that prints the data grouped quarter, the query uses datepart(qq,repo.lesson_date) SQL function. My issue is I want my first quarter to be October-December and not Jan-March like the output I get from the SQL function above. Is there anyone can assist? Answer You may use an additional calculati…

SELECT from table with count from another

I have 2 mysql tables I need to get all views by user, but also need to get the user role (for each view) and calculate a dynamic number of users used for every view. So, I need to get all view columns, plus the role of the user which do this request (from ViewUser), plus count of users for

SQL Query for the player and vsplayer [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question Team Table Expected Output: with Two columns How to write a sql query to get the exact output …

how to query get value without id

I want to get the value of the column regardless of the id of the table, because I want to use GROUP BY to concatenate them from the table : id_child id_master test1 test2 test3 1 1 1 1 0 2 1 1 0 0 3 1 1 0 0 4 2 1 0 0 5 2 1 0 0

Round to nearest 15 minute interval

I’ve seen this question asked and answered for time that is stored as a date, but I have duration of hours and minutes stored as numeric(4,2). For example 2.12, is 2 hours 12 minutes. I need to round that to the nearest 15 minute interval, doing this (CONVERT([numeric](4,2),round(2.12/(25),(2))*(25))) d…