I don't have time to experiment with actual queries, but you can use the
rank() window function to rank rows with prio sorted ascending, and do the
same thing to rank rows with prio sorted descending, and update rows with
the value from the second where the rank matches the rank from the first.
I'
Hi,
there is a table that has among others a integer primary key "id" and
another integer column "prio" as well as an integer "group_id".
I'd like to invert the values of the prio-column for one of the groups.
The prio numbers start with 3 and there are 1159 different prios in this
group.
At
mmh I made a little mistake: it was {A,B} of course, not {A,B,C}
On 08/23/2011 12:03, Julien Cigar wrote:
given D I want {A,B,C}
--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.
<>
--
Sent via pgsql-sql mailing list (pgsql-sql@pos
On 23/08/2011, at 13:31, Jasen Betts wrote:
> On 2011-08-23, Herouth Maoz wrote:
>
>>EXCLUDE USING GIST ( customer_id WITH =, is_default WITH AND )
>
>
>> Basically, each customer can have several rows in this table, but only =
>> one per customer is allowed to have is_default =3D true.
On 2011-08-23, Herouth Maoz wrote:
> EXCLUDE USING GIST ( customer_id WITH =, is_default WITH AND )
> Basically, each customer can have several rows in this table, but only =
> one per customer is allowed to have is_default =3D true. Is this exclude =
> constraint correct?
I don't really
On 2011-08-22, JavaNoobie wrote:
> Hi All,
> I'm trying to write a stored procedure /function to re-order a set of
> calendar months.I have a set of calendar months stored from January to
> December in my tables. And as of now when I do order by on this column ,
> the data is ordered alphabetical
On Tue, Aug 23, 2011 at 1:27 AM, Herouth Maoz wrote:
> My thanks to everyone who replied.
>
> I have decided not to implement that constraint at this time. Using a
> compound type will make the system more complicated and less readable, plus
> requires installing the package which is beyond vanil
Hello,
I have a classic parent -> child relation (id, container_id) and I would
like to find the full hierarchy for a child, something like
A
/ \
B C
|
D
given D I want {A,B,C}
WITH RECURSIVE hierarchy(level, container_id, titles, containers) AS
(SELECT 1 AS level, container_id, ARRAY[
My thanks to everyone who replied.
I have decided not to implement that constraint at this time. Using a compound
type will make the system more complicated and less readable, plus requires
installing the package which is beyond vanilla PostgreSQL.
Now I have another exclusion constraint I'm th