Re: DATE SQL

Поиск
Список
Период
Сортировка
От Mark Lewis
Тема Re: DATE SQL
Дата
Msg-id 1141664650.17684.143.camel@archimedes
обсуждение исходный текст
Ответ на DATE SQL  ("wanpeng" <wanp2005@gmail.com>)
Список pgsql-jdbc
Well, in pure SQL I don't think you could do it without resorting to
ugly tricks like defining an all_days table that had one row per day in
your range, then doing something like, "select from all_days a join xxx
x where a.day >= x.start_date and a.day <= x.end_date"

So . . . don't do that.  What you want isn't really a pure relational
operation, so SQL isn't the right language for it.  Either do it in your
application code, or write a server-side function.

In either case, this is more of a pgsql-general question, since it's not
specific to JDBC at all.

-- Mark Lewis


On Mon, 2006-03-06 at 18:39 +0800, wanpeng wrote:
> I want a result like
>
> '2006-03-01'
> '2006-03-02'
> '2006-03-03'
> '2006-03-04'
>
>
> FROM table xxx
>
> ……| start_date   |   end_date   |……
>     | '2006-03-01' |  '2006-03-04'|
>
> how can I write the sql
>
> thanks
>
> -----------------------------------------------
>                          wanp2005@gmail.com
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: JDBC support for 8.1 OUT parameters
Следующее
От: David Fetter
Дата:
Сообщение: Re: DATE SQL