Re: We all are looped on Internet: request + transport = invariant

From: Dmitry Turin <sql4-en(at)narod(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: We all are looped on Internet: request + transport = invariant
Date: 2007-04-24 12:31:33
Message-ID: 7519129062.20070424153133@narod.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Good day, Joe.

J> "Fictional" is IMO not a good choice for
J> describing aggregates, because it means "a story that is not true",
J> whereas an SQL aggregate is something that is "true" (in the
J> mathematical sense) but is "derived" from other values.

It means, that TML and DDL aggregates have different sense.

J> (I'm not sure what the special symbols mean -- maybe what you need first
J> is a syntax reference for TML)

http://sql4.by.ru/site/sql40/en/author/tree_eng.htm

J> sum of the employees salaries?

yes.
"amount" is quantity of employees

J> How do I see employees in just one department?

department[id="1"].employee >>;

or

department[name="Technical"].employee >>;

J> How do I see a single employee?

employee[id="31"] >>;

or

employee[name="Tomson"] >>;
-- maybe several employee with surname Tomson

J> How do I see all employees that have a salary greater than 3500

department.employee[salary>3500] >>;

J> ordered by their names?

Now sorting for output is absent.
I'm not sure, that it's necessary,
but i already thought about this and continue to think.

J> How do I actually retrieve SUM(salary)

Declare field "sum" as not fictional.

You can always declare field "sum" as not fictional and
put sign "#" before field to prevent output of field.

J> GROUP BY department?

It is always "group by", because it is field of record "department"

P.S.
If you don't like to put sign "#" before field "sum",
or you don't like absence of sorting NOW
(it's possible, that i add sorting),
then remember, that advantage is absence of gasket
(php, etc) between DBMS and external world.
That is more important for un-experienced users.

Dmitry Turin
http://html6.by.ru
http://sql4.by.ru
http://computer2.by.ru

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Turin 2007-04-24 12:35:03 Re: Fwd: Re[2]: We all are looped on Internet:request+transport = invariant
Previous Message David Flegl 2007-04-24 12:12:38 How to get text representation of composite value?