Julester,
> Hi everyone. In my old SQL Server days, I used a command such as "IF
> exists(select name from sys_objects where name = 'xyztable')" to
> check if a
> table existed before creating it with a standard CREATE command. I
> looked
> in the PostgreSQL documentation, but for the life of
> Hi everyone. In my old SQL Server days, I used a command such as "IF
> exists(select name from sys_objects where name = 'xyztable')" to check if a
As far as I know, there is not direct support of this. However, I also
would appreciate a builtin qexec(text) procedure, for making queries.
Now
On Fri, Sep 14, 2001 at 06:58:29PM +, Julester wrote:
> Hi everyone. In my old SQL Server days, I used a command such as "IF
> exists(select name from sys_objects where name = 'xyztable')" to check if a
> table existed before creating it with a standard CREATE command. I looked
> in the Pos
Joseph,
you might want to try:
CREATE VIEW mj1 (jid, cnt) AS
SELECT jid, COUNT(mid) cnt FROM mj GROUP BY jid;
CREATE VIEW ml1 (jid, cnt) AS
SELECT jid, COUNT(*) cnt FROM ml WHERE state <> 11 GROUP BY jid;
CREATE VIEW ml2 (jid, cnt) AS
SELECT jid, COUNT(*) cnt FROM ml WHERE state IN (2,5) GROUP
Try it with something like that:
mydata=# SELECT '1-1-2001'::timestamp + '200 seconds'::interval;
?column?
2001-01-01 00:03:20+01
(1 row)
epoch + seconds = desired timestamp.
Hans
---(end of broadcast)---
T
Is there any command or query to see the definition of an existing table,
like which is the primary key, which is not null etc.
Thanks!
--Ke
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-n
Hi everyone. In my old SQL Server days, I used a command such as "IF
exists(select name from sys_objects where name = 'xyztable')" to check if a
table existed before creating it with a standard CREATE command. I looked
in the PostgreSQL documentation, but for the life of me, I can't find an
equ
Hi All;
Trying to set up a database with postgres. below is what I have so
far...
In the example I want board to be filled with;
Secretary|Goble|David|11/05/1970|280198R
How do I do this? Also is what I have so far the best way for this
database? Later I will want to write an inferface for it,
Hi!
I am in the university now, not be able to test what I
say, so please forgive me if it is buggy or wrong.
So does it helps you?:
CREATE SEQUENCE ordering;
SELECT NEXTVAL('ordering') as rownumber, *
INTO TABLE anewname FROM whatyouwant;
Probably CREATE SEQUENCE 'ordering';, do try it...
Would this give you what you want?
SELECT j.id, j.created, COUNT(mj.mid),
SUM(CASE WHEN ml.state <> 11 THEN 1 ELSE 0 END) AS tally_1,
SUM (CASE WHEN ml.state IN(2,5) THEN 1 ELSE 0 END)AS tally_2
FROM j, mj, ml
WHERE j.fkey = 1
AND mj.jid = j.id
AND ml.jid = j.id;
Hi
I had to write big sql code returning max 10 rows (3 selects 7,10 and 13
joins,
mostly equi-joins - too long to include). I tried do solve this in
different ways:
1. create view
Look at simple test.sql in attachement. Just make psql -f test.sql. I
have PostgreSQL 7.1.2.
I'm used to C,C++, no
Am I right in assuming you were asking for
something like
SELECT Rownumbering(), ... FROM ORDER BY ;
and expecting a result like
1| ...
2| ...
3| ...
...
where Rownumbering() is a PostgreSQL function
If this is what you wanted, this is something
I want for a long time too.
Maybe we
> > After these I use ~= if I need lines with NULLs in both to be selected.
>
> Perhaps you should reconsider your data model. You seem to be treating
The given column is a date type column, with some records where
"date is not given". This "not given" is represented by NULL.
I saw it more elega
Tom Lane a écrit :
Richard NAGY <[EMAIL PROTECTED]> writes:
> SELECT aes.ent_id, e.type, e.nom, aes.sect_id as voulu,
> cvd_new(current_date, e.date_entree, 'new') FROM ass_entrep_sectact
aes,
> entreprise e WHERE e.id = aes.ent_id and aes.sect_id <> 3 and
> aes.sect_id <> 9
> and aes.sect_id <>
Andre Schnabel a écrit :
Hello Richard,
I did some testing and after all your query should be ordered right.
The test's I have done:
Test=# select t.foo1 from testtable t
Test-# union
Test-# select t.foo2 from testtable t
Test-# order by t.foo1;
ERROR: Relation 't' does not exist
Same e
Josh Berkus a écrit :
Richard,
I'm curious now. What happens if you remove the table qualifications,
e.g.:
ORDER BY type, nom;
-Josh
__AGLIO DATABASE SOLUTIONS___
Josh Berkus
Complete information technology
[EMAIL PROTECTE
16 matches
Mail list logo