Re: [SQL] How do I extract ONE particular field, when multiple table contain the same field name?

2001-09-14 Thread Christof Glaser
On Wednesday, 12. September 2001 11:06, Olle Wijk wrote: > Hi, > > I am pretty new att using SQL-quires, could anyone help me with this > one: > > I want to do the following SQL-query: > > Select XID, DENOM, PRICE, FRT, CTID From XItem xi, Category c Where > xi.System=1 and xi.Category=c.Index > >

Re: [SQL] table inheritance and foreign key troubles

2001-09-11 Thread Christof Glaser
On Tuesday, 11. September 2001 11:12, I wrote before I thought: > On Tuesday, 11. September 2001 10:04, Kevin Way wrote: > > I'm having a little trouble with some inherited tables and a foreign > > key. Here's a simplified case, to show the trouble. > > > > CREATE TABLE node ( > > node_id

Re: [SQL] table inheritance and foreign key troubles

2001-09-11 Thread Christof Glaser
On Tuesday, 11. September 2001 10:04, Kevin Way wrote: > I'm having a little trouble with some inherited tables and a foreign > key. Here's a simplified case, to show the trouble. > > CREATE TABLE node ( > node_id SERIAL NOT NULL, > nameTEXT NOT NULL, > PRIMARY KEY (node_i

Re: [SQL] select only the first record

2001-07-10 Thread Christof Glaser
record - any record could be returned. Regards, Christof Glaser ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] How to simulate MEMO data type?Thanks!

2001-04-15 Thread Christof Glaser
On Sunday, 15. April 2001 19:18, Maurizio Ortolan wrote: > Hello! > > I'm porting a database from MS Access > to PostgreSQL. Fine. Did you try the Access97-to-Postgres-7.1-Conversion Tool? Click here: http://www.sevainc.com/Access > How can I simulate in pgsql the 'MEMO' > (up to 65000 chars) d

Re: [SQL] Copying null values

2001-04-10 Thread Christof Glaser
On Tuesday, 10. April 2001 14:17, Amanda Riera wrote: > I would like empty fields from a file being recognised as NULL > values. It doesn't seem to work when a COPY is done, but when I make > an INSERT without > specifying the value, this is recognised as a NULL > > The file I want to copy is: > >

Re: [SQL] Self-Referencing

2001-03-29 Thread Christof Glaser
On Thursday, 29. March 2001 01:38, David Olbersen wrote: [snip] > SELECT > building_id, > num_buildings, > ( > SELECT count( building_id ) > FROM building_portals > WHERE building_id = THIS.building_id > ) > FROM buildings; Try this query (untested), using

Re: [SQL] Foreign key referencing subclasses.

2001-03-22 Thread Christof Glaser
Hi Johannes, On Thursday, 22. March 2001 15:18, Johannes Grødem wrote: > Hi, > > it seems I can't have a foreign key that references some subclass. > Postgres says it can't figure out what its primary key is. The > primary key is defined in the superclass. > > I have something like this: > > CR

Re: [SQL] Re: Normalization is always good?

2001-03-15 Thread Christof Glaser
On Friday, 16. March 2001 00:28, [EMAIL PROTECTED] wrote: > > > Yup. http://www.databasedebunking.com/ Dig through the archives. > > Couldn't find the server... I wonder if it's still there. Try this one: http://www.firstsql.com/dbdebunk/ Regards, Christof -- gl.aser . software engi

Re: [SQL] my pgsql error?

2001-03-13 Thread Christof Glaser
On Tuesday, 13. March 2001 12:53, Christopher Sawtell wrote: > Please could a kind soul help me with this. > I can't find _any_ - however cryptic - docs about plpgsql. Click here: http://www.postgresql.org/devel-corner/docs/programmer/plpgsql.html > create function nice_date(date) returns varcha

Re: [SQL] How to build this field

2001-03-08 Thread Christof Glaser
Josh, > > [ stuff deleted ] > > CREATE FUNCTION metakey (text, int4, int4) returns text as > > ' SELECT $1 || ' ' || text($2) || ' ' || text($3) ' > > LANGUAGE 'sql'; > > > > || is the "concatenate text" operator. > > > > Change the param types and cast them as you need. > > ... But keep in mind

Re: [SQL] How to build this field

2001-03-08 Thread Christof Glaser
Hi Juerg, > I need to build an additional field (metakey) out of three fields in > the table. > > SELECT a.a_kurzbez, a.a_ausgabenr, a.a_bundnr, a.a_nr, a.a_z_blaenge, > a.a_z_laenge, a.a_z_umfang FROM auftrag a > > should be changed to something like > > SELECT (a.a_kurzbez + a.a_ausgabenr + a.

Re: [SQL] Subqueries in Non-SELECT Queries

2000-12-17 Thread Christof Glaser
Frank Joerdens wrote: > mpi=# update index set level = 2 where parentid = ( select id from > index where level = 1 ); > ERROR: More than one tuple returned by a subselect used as an > expression. mpi=# > > This is a recursive query, on a single table. Is that not possible? Hi Frank, as the err