Josh Berkus <[EMAIL PROTECTED]> writes:
> UPDATE assignments SET status = -1
> FROM assignments JOIN orders ON assignments.order_usq = orders.usq
> WHERE orders.status = -1;
> However, I get an error of "Relation assignments referenced twice in
> query."
> Now, I can (and have) re-
Martín Marqués wrote:
> Is it posible to make a rule execute more then one query?
>
> Something like:
>
> CREATE RULE rule_name AS ON INSERT TO table1
> DO INSTEAD
> INSERT INTO table2 VALUES
> (new.value1,new.value2)
> INSERT INTO table3 VALUES
> (x,y)
Yes:
CREATE RULE rule_name AS
On Thu, 26 Apr 2001, [iso-8859-1] Martín Marqués wrote:
> Is it posible to make a rule execute more then one query?
>
> Something like:
>
> CREATE RULE rule_name AS ON INSERT TO table1
> DO INSTEAD
> INSERT INTO table2 VALUES
> (new.value1,new.value2)
> INSERT INTO table3 VALUES
> (x,y)
test=#
Is it posible to make a rule execute more then one query?
Something like:
CREATE RULE rule_name AS ON INSERT TO table1
DO INSTEAD
INSERT INTO table2 VALUES
(new.value1,new.value2)
INSERT INTO table3 VALUES
(x,y)
If not, is there a way to do this? Triggers maybe?
Saludos... :-)
--
El mejor si
On Jue 26 Abr 2001 01:16, Grant wrote:
> > That's because your version (talking about binaries) are not compiled
> > with readline support. :-)
>
> Which binaries are not compiled with readline support?
>
> Why did this change from 7.0.3 -> 7.1?
I don't have the slightest idea.
Are you on rpms? I
On Thu, 26 Apr 2001, Jie Liang wrote:
>
> How I can return random N rows from my select stmt?
> like:
> e.g. what my selectee is a set of 1000 rows, I want randomly
> pickup 100 of 1000.
Interesting problem.
You might get much better responses than this, but, two ideas
that might be workable:
Jie Liang <[EMAIL PROTECTED]> wrote:
>e.g. what my selectee is a set of 1000 rows, I want randomly pickup 100 of
>1000.
Have you tried
SELECT * FROM selectee ORDER BY random() LIMIT 100;
?o
HTH,
Ray
--
JHM, jij bent echt nerd :))
maar wel een goeie :)
Soort van programmerende furby
Jie,
> How I can return random N rows from my select stmt?
> like:
> e.g. what my selectee is a set of 1000 rows, I want randomly
> pickup 100 of 1000.
You'd have to do it inside a function or external program, and copy the
rows to a temporary table (which is what you'd return to the user).
Th
Hi!
> How I can return random N rows from my select stmt?
> like:
> e.g. what my selectee is a set of 1000 rows, I want randomly
> pickup 100 of 1000.
use the LIMIT clause
example
SELECT * FROM test_table LIMIT 100;
you can also use the OFFSET clause to skip to n row and the fetch the n
desi
How I can return random N rows from my select stmt?
like:
e.g. what my selectee is a set of 1000 rows, I want randomly
pickup 100 of 1000.
thanks.
Jie LIANG
St. Bernard Software
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
[EMAIL PROTECTED]
www.stbernard.
Folks,
In 7.1 RC2, I've been trying to use the following JOIN syntax:
UPDATE assignments SET status = -1
FROM assignments JOIN orders ON assignments.order_usq = orders.usq
WHERE orders.status = -1;
However, I get an error of "Relation assignments referenced twice in
query."
Hate to be entirely off topic, but can anyone help me with changing to digest version
of the listserv subscription? I've been all over the site, and can't find the
instructions.
>>> chris G*nther <[EMAIL PROTECTED]> 04/26/01 09:17AM >>>
Hi folks,
I want to do the following: I have a column in
"Wei Weng" <[EMAIL PROTECTED]> writes:
> I know this is not do-able, but is there any way to simulate the
> following in Postgresql 7.1?
> select id from
> (select id, recv_date as date from table1
> union
> select id, send_date as date from table2) AS subtable
> order by date;
What gives you t
Wei Weng writes:
> I know this is not do-able, but is there any way to simulate the
> following in Postgresql 7.1?
>
> select id from
> (select id, recv_date as date from table1
> union
> select id, send_date as date from table2) AS subtable
> order by date;
I haven't actually tried whether this
Mark,
I'd love to help you with your PL/pgSQL function, but since I don't
read Perl, I can't tell what you're trying to do. Can you spell it out
more explicitly?
-Josh
__AGLIO DATABASE SOLUTIONS___
"Emils Klotins" <[EMAIL PROTECTED]> writes:
> Running 7.0.2 on Alpha/RedHat 6.2 256MB RAM
Update to 7.1. 7.0.* has a lot of portability problems on Alphas,
and one of them is that regexps with between 33 and 64 states don't
work (int vs long problem...)
regards, tom lane
I have the command below like it is described in the documentation
(http://www.archonet.com/pgdocs/force-index.html) but it doens't work.
SET SEQSCAN TO OFF;
ERROR: 'seqscan' is not a valid option name
Does anybody know why?
Hans
---(end of broadcast)
Hi folks,
I want to do the following: I have a column in every table, named c_update, it's
purpose is to hold how many times the dataset was updated. This should be done
automatically by the trigger - which already set sthe update-user, -time and date.
How can I do this ???
chris
--
> I have the command below like it is described in the documentation
> (http://www.archonet.com/pgdocs/force-index.html) but it doens't work.
>
> SET SEQSCAN TO OFF;
> ERROR: 'seqscan' is not a valid option name
>
>
> Does anybody know why?
>
Try:
test=> set enable_seqscan to off;
Hans-Jürgen Schönig wrote:
>
> I have the command below like it is described in the documentation
> (http://www.archonet.com/pgdocs/force-index.html) but it doens't work.
>
> SET SEQSCAN TO OFF;
> ERROR: 'seqscan' is not a valid option name
>
> Does anybody know why?
>
because the documentat
> SELECT id, title,publishdate,categoryid FROM articles WHERE
> upper(title) ~ '(BLACK|SERIOUS|SAM)[[:>:]]'::text ;
>
> I think the proiblem is in trnsalte, not in regexp
>
> If you have installed apprporiate character encoding in Postgres,
> 'upper' will work!
>
> Vladimir
Thanks for the adv
I know this is not do-able, but is there any way to simulate the
following in Postgresql 7.1?
select id from
(select id, recv_date as date from table1
union
select id, send_date as date from table2) AS subtable
order by date;
Thanks a lot
Wei
---(end of broadcast)
Hans-Jürgen Schönig writes:
> I have the command below like it is described in the documentation
> (http://www.archonet.com/pgdocs/force-index.html) but it doens't work.
>
> SET SEQSCAN TO OFF;
> ERROR: 'seqscan' is not a valid option name
>
> Does anybody know why?
Because 'seqscan' is not a v
hey guys,
I am writing an article about using Perl inside sql commands.
I am not having a problem with perl, but with pl/pgsql.
The documentation for pl/pgsql isn't helping me out, although I am sure
I will figure it out eventually.
Here is the perl function,
CREATE FUNCTION search_name(employee
At 4/25/2001 07:38 AM, you wrote:
I am working in porting the Slash
software from MySql to PostgreSQL. I
stepped in MySql's REPLACE command (a SQL command) that to my
knowledge
is not supported by PostgreSQL and it's not standard SQL. According
to
MySql's manual:
"REPLACE works exactly like INSERT
Hello Bernardo,
there is a somewhat mathematical solution to your problem.
You can use a unique key, say 0<= k < MAX for each record,
and a second key which is computed from the first, say
f(k), which will give you a unique permutation of the
numbers 0,...,MAX-1. It will not be random, but it wil
Subject: Re: [SQL] using top-level aggregate values in subqueries
Date: Mon, 23 Apr 2001 23:24:48 -0500
From: Ossie J. H. Moore <[EMAIL PROTECTED]>
To: "Thomas F. O'Connell" <[EMAIL PROTECTED]>
I'm a little unclear on what you are trying to do here so I'll take a stab at
explaining how you can c
Running 7.0.2 on Alpha/RedHat 6.2 256MB RAM
In order to implement a fulltext search, I have a func that parses list
of words and creates a regexp query with things like [[:<:]]( word |
word | ... )[[:>:]]
That query then is passed to backend...
Now the strange thing:
gamenet=# SELECT id, tit
28 matches
Mail list logo