Does Oracle have a syntax for this?
---
Robert Treat wrote:
> On Wednesday 23 July 2003 19:06, Bruce Momjian wrote:
> > Robert Treat wrote:
> > > On Wed, 2003-07-23 at 15:38, [EMAIL PROTECTED] wrote:
> > > > FOR myrec IN E
Unsubscribe
---(end of broadcast)---
TIP 8: explain analyze is your friend
Unsubscribe
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEma
On Wed, Jul 30, 2003 at 05:26:23PM -0400, Dmitry Tkach wrote:
> >How do I write a query to find all CDs that are NOT Rock?
> >
> What about
> select * from cd where not exists (select 1 from cd_genres where cd_id
> = cd.id and genre='Rock')?
Thanks everyone! This did indeed work, and it does se
> This doesn't allow multiple genre's per CD, though, does it? A CD
> can only have 1 genre_id. I would like the ability to have multiple
> genres, in which case a third table is necessary:
>
> CREATE TABLE cd_genres (
> cd_id integer,
> genre_id integer
> );
>
> cd_id references cd.id
> On Wed, Jul 30, 2003 at 01:11:35PM -0700, Eric Clark wrote:
> > On Wed, 2003-07-30 at 12:35, Dave Dribin wrote:
> > > CREATE TABLE cd (
> > > id integer unique,
> > > artist varchar(25),
> > > title varchar(25)
> > > );
> > >
> > > CREATE TABLE cd_genres (
> > > cd_id integer,
> > > genre varchar
Dave Dribin wrote:
Hi, I'm having trouble with what I think should be an easy query. For
simplicity, I will use a CD database as an example. Each CD may have
multiple genres. Here's some sample data:
Artist Title Genres
--
On Wednesday 30 July 2003 20:35, Dave Dribin wrote:
> Hi, I'm having trouble with what I think should be an easy query. For
> simplicity, I will use a CD database as an example. Each CD may have
> multiple genres. Here's some sample data:
>
> Artist Title
On Tue, Jul 29, 2003 at 06:32:44PM -0400, Tom Lane wrote:
> The problem is that the rule gets expanded into something rather like
>
> insert into a select ... from new, produce(new.b);
>
> and we can't support that. If we ever add support for SQL99's
> LATERAL(), it might help improve matt
On Wed, Jul 30, 2003 at 01:11:35PM -0700, Eric Clark wrote:
> On Wed, 2003-07-30 at 12:35, Dave Dribin wrote:
> > CREATE TABLE cd (
> > id integer unique,
> > artist varchar(25),
> > title varchar(25)
> > );
> >
> > CREATE TABLE cd_genres (
> > cd_id integer,
> > genre varchar
On Wed, 2003-07-30 at 12:35, Dave Dribin wrote:
> CREATE TABLE cd (
> id integer unique,
> artist varchar(25),
> title varchar(25)
> );
>
> CREATE TABLE cd_genres (
> cd_id integer,
> genre varchar(25)
> );
I think you've got this backwards. There is no advantage i
On Wed, 30 Jul 2003, Jamie Lawrence wrote:
> I have a view:
>
> create or replace view addenda as
> select
> documents.id,
> documents.oid,
> documents.projects_id,
> documents.doc_num,
> documents.description,
> documents.date,
> documents.
Richard,
> I think this is the "adding a table into the FROM" feature of PG. You're
> referring to documents.xxx in the select and d.id in the FROM. PG tries to
> help out by adding the table into the FROM for you - hence cartesian join.
Aha! You're right.
> I think you can turn this "feature
On Wednesday 30 July 2003 21:07, Jamie Lawrence wrote:
> I fully admit that I've been staring at this too long, and simply don't
> understand what is wrong. Apologies aside, any kind sql hackers who care
> to look this over will earn my undying gratitude, and a beer in the bar
> of your choice, sho
Hi, I'm having trouble with what I think should be an easy query. For
simplicity, I will use a CD database as an example. Each CD may have
multiple genres. Here's some sample data:
Artist Title Genres
-- ---
Jamie,
> General issue: I'm getting cartesean products instead of left joins, and
> I feel like a moron.
No, this is extremely bizarre. I can't think of an explanation for the
results you're getting, except that the view definition isn't what you think
it is. Can you do a \d addenda and post
if the constraint are named $1 $2 etc you will need to quote them eg
ALTER TABLE xyz DROP CONSTRAINT "$1" ;
in some version you may require
ALTER TABLE xyz DROP CONSTRAINT "$1" RESTRICT;
What is ur version btw?
try to post the table structure also.
regds mallah.
Elielson Fontanezi wrote:
H
I fully admit that I've been staring at this too long, and simply don't
understand what is wrong. Apologies aside, any kind sql hackers who care
to look this over will earn my undying gratitude, and a beer in the bar
of your choice, should we ever meet.
General issue: I'm getting cartesean produ
Oliver,
> SELECT DISTINCT ON (two.two_id) two.two_value FROM one,two WHERE
> (one.two_id=two.two_id
> AND one.updatenr > two.updatenr) ORDER BY two.updatenr ASC;
FWIW, SELECT DISTINCT ON () is slower than SELECT ORDER BY ... LIMIT 1 on
all stable versions of Postgres. Not that the LIMIT
Mark,
I'm crossing this over to the performance list; it's really appropriate on
both lists. So I'm quoting you in full as well.
> I have a question regarding the performance of a function returning a
> set of a view as opposed to just selecting the view with the same
> where clause. Please
It works in 7.3.2.
George
- Original Message -
From:
Elielson Fontanezi
To: pgsql-general ; pgsql-sql
Sent: Wednesday, July 30, 2003 10:52
AM
Subject: [SQL] ALTER TABLE ... DROP
CONSTRAINT
Hi
all!
Who can tell me what postgres version supports
I think you can do some constraints in 7.2, but 7.3 will allow dropping
them all in that fashion.
On Wed, 2003-07-30 at 11:52, Elielson Fontanezi wrote:
> Hi all!
>
> Who can tell me what postgres version supports ALTER TABLE... DROP
> CONSTRAINT without
> the need of droping the table to re
Hi
all!
Who can tell me what postgres version supports
ALTER TABLE... DROP CONSTRAINT without
the need
of droping the table to remove a simple coinstraint.
(link)
>\\\!/< 55
11 5080
9283
Hi
all!
Who can tell me what postgres version supports ALTER TABLE... DROP
CONSTRAINT without
the need of
droping the table to remove a simple coinstraint. (link)
>\\\!/< 55
11 5080
9283
!_"""_! Elielson
"A. Van Hook" <[EMAIL PROTECTED]> writes:
> this worked in 7.2.3
> "select sum(cr) from ar where date(tdate) = now() -1 "
> but not in 7.3.3
> What's the proper syntax for 7.3.3???
Perhaps you want current_date - 1.
regards, tom lane
---(end of br
Bruce Momjian <[EMAIL PROTECTED]> writes:
> Strangely, CURRENT_TIMESTAMP converts to 'now', not now(). Is that a
> problem?
No, it is not, because the text-to-timestamptz conversion is marked
volatile and won't be const-folded. I've always thought it was a very
ugly implementation though, mainly
You may take a look at jboss connection pool
mechanism. (postgresql.xml).
Also a good way of ensuring that your app will
not leave open stale postgresql connections
is to initially configure your pool to only have a small
number of connections (e.g. 2,3).
If your J2EE components (e.g. jsps) are
On 30/07/2003 10:43 LEON wrote:
Hi,Thank your help yesterday.
Now I met a new question.
When I continued to clicking UI(jsp) some time, I will get a error in
page.It is "Http 404" and Exception is "NullPoinerExcaption".
I checked the log of tomcat. It recorded a message"connected database
failed.
A. Van Hook writes:
> this worked in 7.2.3
> "select sum(cr) from ar where date(tdate) = now() -1 "
> but not in 7.3.3
> What's the proper syntax for 7.3.3???
now() - interval '1 day/minute/year/second/???'
--
Peter Eisentraut [EMAIL PROTECTED]
---(end of broadcast)-
this worked in 7.2.3
"select sum(cr) from ar where date(tdate) = now() -1 "
but not in 7.3.3
What's the proper syntax for 7.3.3???
thanks
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Hi,Thank your help yesterday.
Now I met a new question.
When I continued to clicking UI(jsp) some time, I will get a error in page.It is "Http
404" and Exception is "NullPoinerExcaption".
I checked the log of tomcat. It recorded a message"connected database failed. The user
perporty is missing.
On Wed, 30 Jul 2003, Anagha Joshi wrote:
> Hi All,
> I'm using PG-7.2.4 on Solaries.
> When I do:
>
> template1=# select time(6576);
> ERROR: TIME(6576) precision must be between 0 and 13
>
> Where am I wrong?
IIRC time(n) refers to the type time with a precision of n
and n is limited as stated
> I'm using PG-7.2.4 on Solaries.
> When I do:
>
> template1# select time(6576);
> ERROR: TIME(6576) precision must be between 0 and 13
>
> Where am I wrong?
What's the purpose of this function? And where did you find it in the
docs?
I didn't see it before.
Regards, Christoph
I did try the following:
SELECT DISTINCT ON (two.two_id) two.two_value FROM one,two WHERE
(one.two_id=two.two_id
AND one.updatenr > two.updatenr) ORDER BY two.updatenr ASC;
I thought this would
a) order the result list by updatenr
b) return the first record only for records that are equal on th
Hi All,
Im using PG-7.2.4 on Solaries.
When I do:
template1=# select time(6576);
ERROR: TIME(6576) precision must be between 0 and 13
Where am I wrong?
Pls. help
Thanks,
Anagha
35 matches
Mail list logo