| От | Mark Fox |
|---|---|
| Тема | Days in month query |
| Дата | |
| Msg-id | bca49a9f05033015065f58bb38@mail.gmail.com обсуждение исходный текст |
| Список | pgsql-general |
Greetings, This is more of an SQL question, but since each database server seems to use it's own syntax for handling dates... Is there a way to query for the days in a month? For example, querying for the days in January of this year? Listing the days between two dates would be useful as well. I'm sure I saw a query like this somewhere, but I can't track it down. Just to be clear, there were no tables involved. Just a SELECT statement that returned all the days in a given month. Basically, I have a table of "events" and I'd like to generate a histogram of how many events occur on the days of a particular month. What I do now is create a temporary table, fill it with the appropriate days, and then do a cross join and summation to generate what I need. This works, but seems messy to me. Mark
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера