pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Turin <sql4-en@narod.ru>
To: pgsql-sql@postgresql.org
Subject: Re: We all are looped on Internet: request + transport = invariant
Date: Tue, 24 Apr 2007 15:31:33 +0300
Message-ID: <7519129062.20070424153133@narod.ru> (raw)
In-Reply-To: <1177414707.737.69.camel@pampa>
References: <14110647859.20070413105812@narod.ru>
	<20070413150936.GA31517@phlogiston.dyndns.org>
	<1684192906.20070419090827@narod.ru>
	<20070419134808.GB14187@phlogiston.dyndns.org>
	<814860828.20070420120819@narod.ru>
	<4628A08F.9050804@archonet.com>
	<1177072978.760.40.camel@pampa>
	<7939450187.20070420185808@narod.ru>
	<1177095450.760.71.camel@pampa>
	<1312216062.20070423112045@narod.ru>
	<1177329421.737.39.camel@pampa>
	<922322078.20070424105126@narod.ru>
	<1177414707.737.69.camel@pampa>

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




view thread (29+ messages)  latest in thread

Message-ID: <7519129062.20070424153133@narod.ru>
Permalink:  ../7519129062.20070424153133@narod.ru/
Also on:    postgresql.org/message-id/7519129062.20070424153133@narod.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sql4-en@narod.ru
  Subject: Re: We all are looped on Internet: request + transport = invariant
  In-Reply-To: <7519129062.20070424153133@narod.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox