About 10,500,000 results
Open links in new tab
  1. sql - Sort by day of the week from Monday to Sunday - Stack Overflow

    Dec 1, 2012 · Instead of 'fmDay' use 'D' and it will give you the day of the week from 1 to 7. Then you can easily sort on it. Here's a list of date formats: …

  2. sql - Order by day_of_week in MySQL - Stack Overflow

    Aug 2, 2017 · SELECT @startnum := MIN (id) FROM Weekdays WHERE name='Wednesday'; SELECT * FROM Events INNER JOIN ( SELECT id as weekdaynum, name as dayname …

  3. sql - Order date by day of the week - Stack Overflow

    You can use to_char(<date>, 'd') for the day of the week: SELECT last_name, hire_date, TO_CHAR(hire_date, 'DAY') AS Day FROM employees ORDER BY TO_CHAR(hire_date, …

  4. How to Group Data by Week in SQL Server - LearnSQL.com

    Apr 2, 2020 · In this article, we'll look at different ways to group data by week in SQL Server. How Do You Group Data by Week in SQL Server? SQL Server provides a function called …

  5. SQL Day of Week Functions Explained (With MySQL, PostgreSQL & SQL

    Apr 18, 2025 · Master SQL day-of-week functions with practical examples in MySQL, SQL Server, and PostgreSQL. Learn how to analyze weekday patterns, calculate business days, and …

  6. Group by WEEKDAY and ORDER by WEEKDAY - SQL Server Forums - SQLTeam.com

    Jan 31, 2014 · We've got lots of great SQL Server experts to answer whatever question you can come up with. this query works very well except the last line. the last line causes SQL-Server …

  7. Order by day column using SQL | William Duffy

    Jan 18, 2010 · If you stored the day of the week in numerical format (1 = Sunday, 7 = Saturday) then sorting can be accomplished via a simple order by clause.

  8. sql server - Make a column for each count (*) in a day of the week ...

    COUNT(CASE WHEN DATENAME(dw, reportDate) = 'Sunday' THEN 1 END) AS S, COUNT(CASE WHEN DATENAME(dw, reportDate) = 'Monday' THEN 1 END) AS M, …

  9. Sorting by Day of Week : DAYOFWEEK « Date Time « SQL / …

    -> ('1809-02-12', 'database Lincoln\'s birthday'); -> FROM event. -> ORDER BY DAYOFWEEK(date);

  10. Oracle sql sort week days by current day - Stack Overflow

    May 10, 2013 · If you're trying to sort a set of dates by day of the week, with Saturday being the first, then consider ordering by a modified date: my_date, to_char(my_date,'Day'), …

  11. Some results have been removed
Refresh