Hi,
I'm trying the "nested set model" to handle a tree structure in a
database (reference: http://www.dbmsmag.com/9603d06.html). It has many
advantages if you want to select all nodes above or below a specific
node (recursive calls aren't necessary), but when you want to select
only the first gen
I'm working on a project based on an unusual data model. Some entities
aren't represented by separate tables, they're grouped in the same table
just like the following simplified model shows:
CREATE TABLE class (
id CHAR(8) NOT NULL,
name VARCHAR(30) NOT NULL,
PRIMARY K
> I've got a nasty query that joins a table onto itself like 22 times.
> I'm wondering if there might be a better way to do this, and also how
> I can left join every additional table on the first one. By this I
> mean that if f1 matches my criteria and therefore isn't null, then
> every other joi
> I have a table that has the following columns: AUTHOR_NO, ASMT_CODE, &
> STATUS. The table would look something like this:
> AUTHOR_NO ASMT_CODE STATUS
> 12345 1 PASSED
> 12345 2 FAILED
> 12345 3 FAILED
> 12345 4 PASSED
> 12346 1 PASSED
> 1234
Hi,
In Postgres, which one should be the best data type to be used as
primary/foreign key considering query performance: INT or CHAR? Is there
any "remarkable" difference between them?
Thank you and regards,
--
Renato
Sao Paulo - SP - Brasil
[EMAIL PROTECTED]
> > select * from testdate where field1 between '2000-10-01' and
> > '2000-11-30' ;
> >
> >field1
> >
> > 2000-09-30 < why is it here??
> > 2000-10-20
> > 2000-11-25
>
> It works fine for me (7.0.3, Debian GNU/Linux "unstable").
>
> I suspect your problem has to do with t
> > create table testdate (field1 date);
> > insert into testdate values ('2000-09-30');
> > insert into testdate values ('2000-10-20');
> > insert into testdate values ('2000-11-25');
> > select * from testdate where field1 between '2000-10-01' and
> > '2000-11-30' ;
>
> >field1
> > -
Hi,
Is there any SQL workaround to get the right results from the select
statement bellow? Or am I doing something wrong??
create table testdate (field1 date);
insert into testdate values ('2000-09-30');
insert into testdate values ('2000-10-20');
insert into testdate values ('2000-11-25');
sel
I don't have a postgresql instalation right now to do some tests, but maybe it works...
SELECT crs.dept AS department,
ROUND(AVG(CAST(rvs1.score AS FLOAT)) ,2) AS snooze,
ROUND(AVG(CAST(rvs2.score AS FLOAT)) ,2) AS professional,
ROUND(AVG(CAST(rvs3.score AS FLOAT)) ,2) AS per
Didn't test this, but I think it should also work:
SELECT a.oid_fld
FROM for_payment a, for_payment b
WHERE b.serial_fld = 2
AND b.char_fld = a.char_fld
AND a.serial_fld <> 2
--
Renato
Sao Paulo - SP - Brasil
[EMAIL PROTECTED]
> Is there a better way to write this:
>
> SELECT a.oid_fld FROM for
> > Consider the following tables/fields:
> > table "person": fields "p_id", "p_name".
> > table "person_attribute": fields "a_id", "a_name".
> > table "person_data": fields "d_person_id", "d_attribute_id",
> > "d_value".
> >
> > Also consider that a person may not have data related to all possibl
Yes, Ryan, the idea is to use only one row with all attributes in it.
The structure I described is easy to use when you want to know the attributes
of a single person, and in this case your suggestion is the way to go - I knew
that.
I asked the question considering a specific person_id just to s
12 matches
Mail list logo