e query would look like the following:
SELECT MAX(timest)
FROM table
WHERE id IN (1,2,3)
GROUP BY id;
Q2) On the other hand, the 2nd query seems to take advantage of "table"
index on its primay key (id,timest) as the 2 columns are explicitely
referred in WHERE clauses. The sub-select would
Hello again,
Le 29/07/09 12:21, nha a écrit :
> Hello,
>
> Le 29/07/09 11:48, Gau, Hans-Jürgen a écrit :
>> Sorry, it's a lapse by copying and simplification the original version. that
>> is correct:
>>
>> UPDATE table1 t1
>> SET (t1.id) =
table and the SELECT expression in the WHERE
clause; table1 is called (in fact, a copy of this table is implied) but
no column of this table is bound to one or more of the current updated
table1. I may mistake...
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
gt; AND t1.id <> t3.id
>
> AND h.id IS NOT NULL);
>
Beyond the solution brought by Daryl Richter, it seems that "h" is an
unbound alias in the original (and also in the suggested) query. Some
clarification would be help
ed that user_id and log_type_id are
respectively keys for users and log_type tables, it is semantically
admitted here that user_name identifies user_id in users table and
log_type identifies log_type_id in log_type table.
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql
Hello again,
Le 25/07/09 0:41, nha a écrit :
> Hello,
>
> Le 23/07/09 11:59, bartjoosen a écrit :
>> Hi,
>>
>> I made up a query to make a count for each item for each month/year:
>> SELECT"Artnr_ID", to_char("Date_plan","&q
hanks
>
> Bart
>
The error message you meet is missing in your report although it could
surely help in accurate analysis. However I guess it is about using
alias (like "Monthly_count") for defining project columns (like the one
you tried and failed). Alias columns are used to rena
nnot do that. You can only detect that a value has changed.
>
There would be one way to detect a value change but it is more related
to application management than to data manipulation. For the column c2,
it could be assumed that a flag is set when (a row of) c2 is updated.
Such a flag m
plicity of value s.name and/or p.name may
result depending on the keys of tables (as implicitly mentioned by Peter
Eisentraut).
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
issued from the original one. WHERE and SORT clauses have been pulled
off so that subqueries are not too enough broken down. Other
optimization may be applied (eg. by using explicit joins between the
different tables and by checking appropriate indexes are set up).
Regards.
--
nha / Lyon / France.
-
unctions may be user-created. The
sorting speed may then depend on the meaning of integer values (numeric
relation relevance) with your data.
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
ay be performed (see
also documentation of PostgreSQL 8.4):
http://www.postgresql.org/docs/8.4/interactive/sql-copy.html
Assuming that a CSV file contains data with column headers c1, c2, and
c3, the following statement would retrieve only columns c1 and c2 from
this file to a table t1:
COPY t1(c1
e, each
column of the target table may be tested with their respective new and
old values as well.
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Hello,
Le 8/07/09 11:30, nha a écrit :
> Hello,
>
> Le 30/06/09 8:47, Daniel Gordon a écrit :
>> I'm trying to record the results of a select statement into a separate
>> table. I need the information selected, the column it was stored in,
>> the table it w
s your purpose while both query and
objects (tables and columns) are directly known and can be handled for a
log query.
Hoping these ideas help you go on investigating.
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
s many
others for the current customer. This "edge effect" may be avoided in
many ways depending on the original purpose.
Regards.
--
nha / Lyon / France.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
16 matches
Mail list logo