Stephan Szabo <[EMAIL PROTECTED]> writes:
> Coalesce((select max(pos)+1 from tab2), 0)
> should work.
Small comment: it's probably noticeably faster to do
(select Coalesce(max(pos), 0) +1 from tab2)
I think that the former will result in two evaluations of the sub-select
in the typical c
Joseph Syjuco wrote:
>
> how can i get the current date (without the time part) in sql. I tried
> doing a select now() but it also gives me the time part
test=> SELECT CURRENT_DATE;
date
2002-10-17
(1 row)
--
Bruce Momjian| http://candle.pha.p
how can i get the current date (without the time part) in sql. I tried
doing a select now() but it also gives me the time part
TIA
joseph
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Keith:
I think it would be great to get the optimizer to do something smart on
such a simple (and common) query. I am porting an app to Postgresql and
I am not looking forward to having to fix all the postgres-ism that
seem trivial like this. Postgres gets a bad rap for this kinda simple
q
Richard Huxton wrote:
>>> As of now, Max() doesn't utilizes the indices hence
>>>it always do a sequential scan.
>>Is this likely to be sorted in 7.2 ?
>>Is anyone looking at this?
> As I understand, the problem is that the optimisation only applies for simple
> cases...
Getting MIN() adn
This is what I ended up with:
SELECT c1.uid, count1, count2
FROM (SELECT uid, count(uid) AS count1
FROM triangulated WHERE uid != 'anonymus'
AND uid != 'anonymous'
AND uid != '' GROUP BY uid) AS c1
LEFT JOIN (SELECT uid,count(uid) AS count2
FROM points
WHERE uid != 'anonymus'
AND uid != 'anonymou
On Wed, 2002-10-16 at 19:26, Eric L. Blevins wrote:
> I've got 2 SQL statements I would like to combine into one.
...
> statement 1: SELECT uid, count(uid) FROM triangulated WHERE uid != 'anonymus' AND
>uid
> != 'anonymous' AND uid != '' GROUP BY uid ORDER BY count DESC LIMIT 10;
...
> statemen
I'm new to postgres.
I've got 2 SQL statements I would like to combine
into one.
I think I need to use a sub select or join I am not
sure.
Any help would be appreciated!
statement 1: SELECT uid, count(uid) FROM triangulated WHERE uid !=
'anonymus' AND uid!= 'anonymous' AND uid != '' GRO
I have a table that has a frild called ID.
I will be inserting data into that field that will
either be a unique number or blank, Is there a way to
do this either at table creation time or by using some
check() voodoo?
Thanks.
--
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com
---
Charles,
CREATE TABLE phone_types (
type VARCHAR(10) NOT NULL PRIMARY KEY
);
INSERT INTO phone_types
VALUE ( 'Work' );
INSERT INTO phone_types
VALUE ( 'Home' );
etc ...
CREATE TABLE phone (
phone_id Identifier_type IDENTITY,
phone_number varchar(20
On 16 Oct 2002, Charles Hauser wrote:
> In fits and starts I am working through converting a sybase schema ->
> postgres and am hoping to gain some insight on the use of reference
> tables ('look-up-table') and FK constraints.
>
> In the example below I believe the sybase RULE Phone_type_rule is
Hi,
In fits and starts I am working through converting a sybase schema ->
postgres and am hoping to gain some insight on the use of reference
tables ('look-up-table') and FK constraints.
In the example below I believe the sybase RULE Phone_type_rule is used
to restrict input, so that the only v
On Wed, 16 Oct 2002, Albrecht Berger wrote:
> Hello,
> I have a statement like this :
>
> INSERT INTO tab1 (c1, c2, c3) VALUES (1,2, SELECT MAX(pos)+1 FROM tab2);
Coalesce is your friend. :)
Coalesce((select max(pos)+1 from tab2), 0)
should work.
---(end of broadcast)
=?iso-8859-1?Q?Domoszlai_L=E1szl=F3?= <[EMAIL PROTECTED]> writes:
> So, do you think a DIFFERENCE or EXCEPT SYMMETRIC clause will be reasonable
> feauture for postgresql?
I doubt it; haven't heard a request for it before, and AFAICS there's no
such thing in the SQL spec...
Tom Lane wrote:
> > I would like to make symmetrical(set) difference in a query.
> > But the simpliest way I could find is
>
> > select id from a
> > except
> > select id from b
> > union
> > select id from b
> > except
> > select id from a
>
> > Is there any better solution for this problem?
Hi,
Table xxx:
(...)
CPF numeric(11,0)
(...)
Select x,y,CPF from xxx where CPF='12345678901'
Generate the error:
error reading "12345678901": Numerical result out of range
The corversor recognize the 'number' like a integer and not like a numeric
type ???
I use Win ODBC-7.2.00.3 and Post-7.
On Wednesday 16 October 2002 12:07, Albrecht Berger wrote:
> Hello,
> I have a statement like this :
>
> INSERT INTO tab1 (c1, c2, c3) VALUES (1,2, SELECT MAX(pos)+1 FROM tab2);
>
> This works fine if the subselect returns a value, but if it returns
> null there is a problem. In this case a 0 has
Hi:
Suppose I have a transaction (T1) which executes a
complicated stored procedure. While T1 is executing,
trasaction #2 (T2) begins to execute.
T1 take more time to execute that T2 in such a way
that T2 finished earlier than T1. The result is that
t2 returns set of data before it can
Hello,
I have a statement like this :
INSERT INTO tab1 (c1, c2, c3) VALUES (1,2, SELECT MAX(pos)+1 FROM tab2);
This works fine if the subselect returns a value, but if it returns
null there is a problem. In this case a 0 has to be inserted.
Is there any pg function which solves this problem ?
I
19 matches
Mail list logo