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
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
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
12346 2
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 joined
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 the "DATESTYLE"
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');
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
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
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 possible
10 matches
Mail list logo