pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedcase statement in group by clause
2+ messages / 2 participants
[nested] [flat]
* case statement in group by clause
@ 1970-01-01 00:00 Dorian Taylor <leg0@hotmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Dorian Taylor @ 1970-01-01 00:00 UTC (permalink / raw)
To: pgsql-sql
Greetings,
I can't remember if I asked the list this before (it's been a very hectic
month), if so, please disregard. I'm trying to find the most elegant way of
integrating SQL into an application I am writing which has a potential for
N^3*M fairly similar queries (Luckily enough N is 3 and M is 6, but could
easily and very soon become more). Rather than explicitly write each of
these out, or concoct some sort of illegible mutant
string-concatenation/bind parameter frankenstein, I would like to simply
create one massive query riddled with case statements triggered by named
bind parameters. What is holding me back from this is the inability to
coerce certain column types in a case statement in a GROUP BY clause. Now,
the obvious solution would be to flatten each test out to return a value of
the same type, although I'm not too sure how to access the original sorting
function/operator that is associated with a GROUP BY clause. I'm sure this
isn't a new problem, but I've run into great difficulty finding anything on
the subject. Please advise.
Regards,
Dorian
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: case statement in group by clause
@ 2002-04-15 14:35 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dorian Taylor <leg0@hotmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2002-04-15 14:35 UTC (permalink / raw)
To: Dorian Taylor <leg0@hotmail.com>; +Cc: pgsql-sql
"Dorian Taylor" <leg0@hotmail.com> writes:
> What is holding me back from this is the inability to
> coerce certain column types in a case statement in a GROUP BY clause.
What? Example please.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-04-15 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1970-01-01 00:00 case statement in group by clause Dorian Taylor <leg0@hotmail.com>
2002-04-15 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox