13,946 reputation
12253
bio website
location Munich, Bavaria
age
visits member for 3 years, 10 months
seen 15 mins ago

Sep
22
revised How to use join with this query?
edited tags
Sep
22
comment composite index vs normal index
Check out this website. It really explains how to use indexes: use-the-index-luke.com
Sep
22
comment Using subqueries in delete query
where (SELECT * FROM candidate limit 1,1) is wrong. You need to use where some_column IN (select other_column ...) But don't do that with MySQL. MySQL is horribly bad at using sub-queries. Use a join instead.
Sep
22
comment Using subqueries in delete query
MySQL neither supports common table expressions nor window functions.
Sep
21
answered where is the oracle 12c logfile?
Sep
19
comment dm_exec_query_stats in PostgreSQL
the pg_stat_statements extension is probably the closest thing: postgresql.org/docs/current/static/pgstatstatements.html
Sep
19
comment Foreign key without referenced columns specification
The rule is actually: "an implicit foreign key references the primary key - and only the primary key - of the referenced table". A unique constraint will never be eligible for this (it's the same in Postgres btw).
Sep
18
comment What is faster, one big query or many small queries?
@jynus: well, the question is very broad (plus: I said "in my experience" - other people might have different experiences). A query inside a LOOP is never a good idea and almost always the result of poor design or lack of understanding how to work with a relational database.
Sep
18
comment What is faster, one big query or many small queries?
My experience is that MySQL doesn't like complicated queries and is usually faster with very simply queries (but more). Postgres' query optimizer is much better and there it is usually more efficient to run a single large query.
Sep
18
answered using string concatenation to reference a table
Sep
18
comment Trying to set up new data_directory on Postgres 9.3
As I don't have any experience with Ubuntu I don't think my answer would be detailed enough. Feel free to add that to yours.
Sep
18
comment Trying to set up new data_directory on Postgres 9.3
So just moving the directory and adjusting postgresql.conf does not work on Ubuntu? Seems like a strange way to install it.
Sep
18
comment Trying to set up new data_directory on Postgres 9.3
But he only wants to move the data directory not completely delete everything.
Sep
17
comment Use serial ID for multiple columns and return it from INSERT
This question has several solutions to the "insert or update" problem: stackoverflow.com/q/1109061/330315
Sep
17
comment Use serial ID for multiple columns and return it from INSERT
Unrelated but: WHERE Id = currval('mytable_id_seq') is enough. No need for a select there.
Sep
17
revised Selecting most recent date when dates are stored in another table
edited tags
Sep
17
comment exporting DDL of all views Oracle
select dbms_metadata.get_ddl('VIEW', view_name) from user_views then spool the output to a file - how you do that depends totally on the SQL client you are using.
Sep
16
comment why is the name `loop` treated differently in PostgreSQL
You should add that the quoting is only needed within PL/pgSQL, not for plain SQL.
Sep
16
revised Need to group by column while ignoring some text format
deleted 32 characters in body
Sep
16
revised Need to group by column while ignoring some text format
added 321 characters in body