[GENERAL] Deleting all but one row of a list of non-uniques

2004-06-22 Thread Zak McGregor
Hi all I have a table, for simplicity's sake containing one field, called unid. for example, select unid, oid from table gives me something like this: unid | oid -+- XNO24ORK | 40276607 XNPGJDPU | 40276673 * XNPGJDPU | 40276674 * XNXAAVQ2 | 40277583 ZAZAFAA4 | 40

Re: [GENERAL] count(1) return 0?

2004-06-09 Thread Zak McGregor
On Mon, 01 Mar 2004 13:12:12 +1100 Klint Gore <[EMAIL PROTECTED]> wrote: > The counting and grouping is done after the where clause is applied. > > since player iplaybadly (who was 1200's opponent) didnt win any, he/she > is not included in the result set to be grouped and counted. You need > to

Re: [GENERAL] count(1) return 0?

2004-02-29 Thread Zak McGregor
On Mon, 01 Mar 2004 12:13:07 +1100 Klint Gore <[EMAIL PROTECTED]> wrote: > On Mon, 1 Mar 2004 02:14:56 +0200, Zak McGregor <[EMAIL PROTECTED]> wrote: > > to return a 0 value instead of absolutely nothing if no rows match > > fixture=4916 and winner=away? I get a

[GENERAL] Large OR query

2001-06-12 Thread Zak McGregor
better way to do this please? Thanks Ciao -- Zak McGregorhttp://www.carfolio.com - Over 7000 car specs online Web mercenary - currently for hire. Perl/html/.js/sql/cgi/GNUlinux/php + - "Trying to make bits uncopyable is

Re: [GENERAL] Queries across multiple databases  (was: SELECT from a table in another database).

2001-05-21 Thread Zak McGregor
etter time with things if I could span databases in a single request. Are there theoretical problems with spanning databases in a single query? Is it a feature of bad database design & implementation? Thanks Ciao Zak -- =======

Re: [GENERAL] formatting a date

2001-05-10 Thread Zak McGregor
btw. See http://postgresql.readysetnet.com/users-lounge/docs/7.1/user/functions-formatting.html (watch for potential wrapping of the link) for more info. -- ======== Zak McGregor http://www.carfolio.co

Re: [GENERAL] Data transfer format between UNIX server and Windows client?

2001-04-05 Thread Zak McGregor
On Thu, 05 Apr 2001 09:25:28 -0500 "Paul A. Lender" <[EMAIL PROTECTED]> wrote: > MY QUESTION -- When query results are sent to the client, where does the > conversion of stored binary data to easily readable text take > place: on the server before it leaves for the clients, or at libpq.dll > ON

Re: [GENERAL] How to copy a table?

2001-03-26 Thread Zak McGregor
On Mon, 26 Mar 2001 21:21:12 -0500 "Jeff" <[EMAIL PROTECTED]> wrote: > Hi, > > Can some one show me what's the best way to backup a table or copy a table? Backing up is simple with pg_dump and pg_dumpall. Copying a table (assuming within the same database) is also easy: create table test as s

Re: [GENERAL] How to auto create a unique key for each newly added record?

2001-03-26 Thread Zak McGregor
On Mon, 26 Mar 2001 21:20:13 -0500 "Jeff" <[EMAIL PROTECTED]> wrote: > Hi, > > How to if it is possible to let postgresql to auto assign unique key to each > new record that is added to the database? > Just set up the table with the field you are wanting to have as a unique id as type "serial"

[GENERAL] Views, indices and pg_dump

2001-03-26 Thread Zak McGregor
Hi all Thanks to everyone for this great forum, and for Postgres! I have a couple of questions: I have a smallish table which I join on another (smaller) table. I have created a view for this purpose, thinking it would save on overhead. The view also incorporates some calculated fields. However

[GENERAL] Joins and field types

2001-01-12 Thread Zak McGregor
Hi all What sort of performance penalty on joins using varchar(n) vs. int fields can I expect if both tables are fairly small (ie unlikely to have more than 2 rows each)? Is there a good reference or two on these sorts of questions? thanks a lot Ciao Zak McGregor