RE: [SQL] Re: DB porting questions...

2001-04-18 Thread Michael Fork
TE TABLE wwwlogs (id INT4, url TEXT); CREATE TABLE wwwlogs_041801 INHERITS (wwlogs); CREATE TABLE wwwlogs_041701 INHERITS (wwlogs); HTH... Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio > Querying the entire database is difficult, and very important to me.

Re: [SQL] serial type; race conditions

2001-03-29 Thread Michael Fork
date fails, the number will be accounted for in the table (Note that you could not use not null on any of the columns). Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Thu, 29 Mar 2001, postgresql wrote: > How does currval work if you are not inside a transact

Re: [SQL] counting distinct rows on more than one column

2001-03-28 Thread Michael Fork
In 7.0.3, I believe the following would work: SELECT count(distinct(a || b)) FROM t; if subselects in from were supported in 7.0.3 as they are in 7.1, you could do: SELECT count(*) FROM (SELECT DISTINCT a,b FROM t) FROM x Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access

Re: [SQL] Still don't know how to build this string ?

2001-03-26 Thread Michael Fork
L/PGSQL must be installed first, which can be done by typing createlang plpgsql at a shell prompt as a postgres super user. Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Mon, 26 Mar 2001 [EMAIL PROTECTED] wrote: > Hello there > > I have still the

Re: [SQL] I need an aggregate with 2 parameters

2001-03-12 Thread Michael Fork
This should work: SELECT day, rain FROM meteo WHERE rain = (SELECT max(rain) FROM meteo WHERE date_part('year', day) = '2001') Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Thu, 8 Mar 2001, Salvador [iso-8859-1] Mainé wrote: &g

[GENERAL] Re: [SQL] Date question

2001-03-06 Thread Michael Fork
This will do it: mfork=# SELECT to_char(now() + '1 Year'::interval, '-MM-DD'); to_char 2002-03-06 (1 row) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 6 Mar 2001, Boulat Khakimov wrote: > Hi, >

Re: [SQL] Re: [GENERAL] MySQLs Describe emulator!

2001-03-06 Thread Michael Fork
ypname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum FROM pg_class c, pg_attribute a, pg_type t WHERE c.relname = '<>' AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY a.attnum Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet A

Re: [SQL] Comparing dates

2001-03-06 Thread Michael Fork
ND date_date <= '03-03-2001'::date; SELECT count(*) FROM table WHERE date_date >= '03-02-2001'::date AND date_date < '03-04-2001'::date; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 6 Mar 2001, Markus Fischer wro

Re: [SQL] Optimizing Query

2001-03-05 Thread Michael Fork
Did you run VACUUM ANALYZE after running CLUSTER? Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Mon, 5 Mar 2001, Justin Long wrote: > Ok, now I have another question... it doesn't seem to be accessing the index. > > explain select k.kbi

Re: [SQL] distinct date problem

2001-02-26 Thread Michael Fork
This should work: SELECT distinct(date_part('year', )) FROM <>; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Sun, 25 Feb 2001, Lotus118 wrote: > Hi, > I'm having difficulty figuring this one out: > I have a table with r

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Michael Fork
SELECT * FROM basket ORDER BY date desc LIMIT 1; and SELECT * FROM basket WHERE fruit = 'apple' ORDER BY date desc LIMIT 1; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Fri, 16 Feb 2001, Steve Meynell wrote: > Hi, I am not sure if this

Re: [SQL] plpgsql grief

2001-02-12 Thread Michael Fork
syntax rather than INTO. This was a misconception on my part, which has obviously lasted longer than I'd hoped ;-) I believe this was the consensus reached on the hacker's list. Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio

Re: [SQL] Wierd postgres Problem

2001-02-12 Thread Michael Fork
Your missing your fields types, i.e.: CREATE TABLE media_received ( comp_id SERIAL NOT NULL, dept_id INT4NOT NULL, date_recTIMESTAMP DEFAULT 'now', that should fix your problem... Michael Fork - CCNA - MCP -

[GENERAL] Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?

2001-02-07 Thread Michael Fork
You could try this to see if it makes a difference UPDATE tblpemdruglink SET monographid = substr(monographid, 1, length(monographid) - 1) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Wed, 7 Feb 2001, Brice Ruth wrote: > I believe we're

[GENERAL] Re: [SQL] Re: SQL Join - MySQL/PostgreSQL difference?

2001-02-07 Thread Michael Fork
x27;FDB-PE' AND fdb.category='PEM' AND pem.drugid='DG-5039'; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 6 Feb 2001, Brice Ruth wrote: > FYI: Here are the table definitions: > > CREATE TABLE

Re: [SQL] const cast ?

2001-02-02 Thread Michael Fork
ok -- both available on the website) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Fri, 2 Feb 2001 [EMAIL PROTECTED] wrote: > Hello Postgres Users and Developers, > > I have the following scenario: > create table t (i int); > create index ti on t(

Re: [SQL] no value for numeric filed in SQL statement causes anerror

2001-01-31 Thread Michael Fork
nd leave it blank, a value *must* be specified. Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Wed, 31 Jan 2001 [EMAIL PROTECTED] wrote: > Hi there > > I have a table with char and int fields. From my form I get no values back > for int fiel

Re: [SQL] unreferenced primary keys: garbage collection

2001-01-23 Thread Michael Fork
records are left, the delete will succeed (you have to do it outside of transaction, otherwise I belive it will rollback on the error if other rows are found to be referencing the primary key) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 23 Jan

Re: [SQL] Problem with function...

2000-12-18 Thread Michael Fork
I don't think you return should have '' around them, i.e. RETURN distance; Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Mon, 18 Dec 2000 [EMAIL PROTECTED] wrote: > Hi, > > I hope my question is appropriate for this list.

Re: [SQL] count( distinct x )

2000-11-27 Thread Michael Fork
I think you want SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%' Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Mon, 27 Nov 2000, Anthony wrote: > Apologies if this has been asked b4, but got this result when >

Re: AW: [SQL] Table Attribute Help

2000-10-10 Thread Michael Fork
a.attrelid = c.oid AND a.atttypid = t.oid AND c.oid = d.adrelid AND d.adnum = a.attnum) ORDER BY a.attnum; - Michael Fork - CCNA - MCP -

Re: [SQL] OID Perfomance - Object-Relational databases

2000-10-03 Thread Michael Fork
default nextval('test_seq'::text), ... } and so on... I have never tried this, but i don't see why it wouldn't work Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 3 Oct 2000, Josh Berkus wrote: > Tom, >

Re: [SQL] Re: Simple search question

2000-06-12 Thread Michael Fork
xec() was not an INSERT. Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Tue, 13 Jun 2000, Alex wrote: > Hi, > > > What language is your "script" written in? Based on some previous posts, > > I guess you're talking about a P

[SQL] Index Scans

2000-06-05 Thread Michael Fork
ws=5588 width=24) EXPLAIN radius=# set enable_seqscan=off; SET VARIABLE radius=# explain **INSERT QUERY** NOTICE: QUERY PLAN: Sort (cost=17500.82..17500.82 rows=5588 width=24) -> Index Scan using idx_radacct_8 on radacct (cost=0.00..17153.01 rows=5588 width=24) EXPLAIN Thanks Mich