8,135 reputation
11027
bio website
location Munich
age
visits member for 2 years
seen 3 mins ago
stats profile views 733

I'm looking for job as a software developer (Java) with focus on relational database technologies (Oracle, PostgreSQL)


Apr
25
comment Combine multiple queries into single query
You might want to add a column that identifies the "source" of each row to be able to distinguish between driver, freight and locomotive.
Apr
25
comment Combine multiple queries into single query
Why the group by you are not aggregating? You are also missing join conditions (preferrably using using standard SQL 92 JOINs)
Apr
25
comment Are database query optimizers aware of storage performance differences?
Oracle generates "system statistics" which measure (amongst other things) the latency (and performance) of the disk access and includes those values into the plan. For Postgres you can manually set a scale on how "expensive" certain IO operations which is also used by the planner.
Apr
24
comment “Rewinding” a Postgresql database
You could use point in time recovery to restore a backup to a specific time: postgresql.org/docs/current/static/continuous-archiving.html
Apr
24
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
@Colin'tHart: I know ;) I just didn't want to introduce too many new things (And I wanted to somehow stay close to the original query).
Apr
24
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
@Douglas: hv is an alias for the derived table (aka "sub-query"). And you are right, I forgot the alias inside the derived table.
Apr
24
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
@Douglas: "common-sense" is nothing you can put into code. So Postgres (or any other DBMS I would assume) can only use the information that is available in the metadata - which is the PK information.
Apr
24
comment How to snapshot or version a relational database when data changes?
Which DBMS are you using? Oracle has "flashback" queries and DB2 (10.1) has "time travel" queries. Both store historical data in separate tables, so the performance of queries for the "current" data is not affected
Apr
23
comment Storing data as rows as opposed to columns
If you are using Postgres, have a look at hstore. It is essentially a key/value store (or to go with the hype: a NoSQL) which will make this kind of dynamic attribute much easier to deal with.
Apr
23
comment Why PostreSQL 9.2 does not use index scan if it can?
Did you analyze the table. Maybe you have wrong statistics
Apr
23
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
@Douglas: using window functions might give you a better performance. You can compare the execution plans to find out which one is more efficient.
Apr
23
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
which Postgres 9.1 (and later) does: postgresql.org/docs/current/static/sql-select.html#SQL-GROUPBY
Apr
23
comment need the most efficient way to handle unique constraint errors
You can use log errors into together with the insert statement. Don't know if that is compatible with the APPEND hint though: docs.oracle.com/cd/E11882_01/server.112/e26088/…
Apr
23
comment Following procedure generates an error and I cannot find the reason
Please edit your question. Posting unreadable code in the comments makes it even worse.
Apr
23
comment Error “column does not exist” in a SELECT with JOIN and GROUP BY querry
"does not authorize to use the columns in the SELECT clause if they do not appears in the GROUP BY clause" so does every other sensible DBMS.
Apr
23
comment How Can I do and INNER JOIN USING (2 columns)?
What happened when you tried?
Apr
23
comment Following procedure generates an error and I cannot find the reason
And the error is?
Apr
23
comment Oracle SUM - ORA-00937: not a single-group group function
@Colin'tHart: it's not clear for me from the original question what David wants. So I copied all the columns from the original SELECT. I agree that it's very likely that this is not what he is after - your answer is probably the way to go.
Apr
23
comment How to properly format sqlite shell output?
re 2: you might try henplus or SQL Workbench/J. Both are Java/JDBC based and should work with SQLite. henplus.sourceforge.net sql-workbench.net
Apr
22
comment Storing data in PostgreSQL: One table or two?
Which is a piece of cake using the range type and exclusion constraints....