Reputation
15,365
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
2 29 58
Newest
 Caucus
Impact
~988k people reached

Jul
9
comment How to find similar (but different) names with the same soundex value?
And please do not post SQL statements as screen shots. Show the statements as formatted text.
Jul
9
comment Cann't connect from another server to Oracle
@miracle173: of course hostname needs to resolve to the alias defined in tnsnames.ora. From the manual "You must enter (...) a net service name to connect to a database". If lsnrctl status doesn't show the service than this does indicate the instance didn't register.
Jul
9
comment Cann't connect from another server to Oracle
Looks like your instance didn't register with the listener. What happens if you connect locally and run alter system register. Also what does tnsping hostname give you? Are you aware that you the "hostname" part isn't really a "hostname" but a "TNS name" - as defined in tnsnames.ora
Jul
8
comment ANY in postgresql gives weird error
see: stackoverflow.com/a/31292583/330315
Jul
8
comment Error while restoring Postgres DB Dump
Not really proficient in Linux shell, but shouldn't that be gunzip -c my_db_dump.sql.gz | psql ...?
Jul
8
comment Firebird-Time Interval- between 2 Dates
Although a correct answer, it's probably better if you include a complete SQL statement that can be executed directly rather than just a code fragment.
Jul
8
comment Split field values using specific character
Which DBMS are you using? Postgres? Oracle?
Jul
7
comment How to partition existing table in postgres?
Nice writeup. It would be interesting if that actually makes your queries faster. 10 million still isn't that many rows that I would think about partitioning. I wonder if your degrading performance was maybe caused with vacuum not catching up or being prevented due to "idle in transaction" sessions.
Jul
7
comment How to print to console in SQL?
Cross post: stackoverflow.com/questions/31260497/…
Jul
7
comment How to print to console in SQL?
There is no equivalent top raisein plain SQL
Jul
6
comment Postgres 9.4.4 query takes forever
Try ... WHERE (id, group_number) NOT IN (select id, group_number from table_two) ... instead of using the concatenated values. That might be able to use a combined index on the columns. You can also try to rewrite the NOT IN into a NOT EXISTS co-related subquery, sometimes that performs better.
Jul
6
comment Postgres 9.4.4 query takes forever
wiki.postgresql.org/wiki/Slow_Query_Questions
Jul
6
comment Where to place a foreign key column?
This is all about coding standards. The usual answer is: pick one and stick to it.
Jul
6
comment Where to place a foreign key column?
The order of columns in a relational table is irrelevant.
Jul
6
comment ERROR: no schema has been selected to create in
Maybe your user doesn't have the necessary privileges to create tables in the public schema.
Jul
6
comment How to partition existing table in postgres?
For just few million rows I don't think partitioning is actually necessary. Why do you think you need it? What problem are you trying to solve?
Jun
24
comment Is there an equivalent in postgresql to MySQL's “safe update mode” or “safe delete mode”?
Are you referring to the MySQL's command line client's parameter --i-am-a-dummy? That depends on the SQL client you are using. Some offer this, some don't. psql does not have such a parameter.
Jun
24
comment Insert from Another Table + Removing Duplicate Entries in Postgres
Exception handling is only available in PL/pgSQL, not in plain SQL - you need to write a stored function to catch an exception. In PL/pgSQL, BEGIN starts a block and does not need a ;. You are confusing BEGIN TRANSACTION; (which is a SQL statement) with the BEGIN from PL/pgSQL: postgresql.org/docs/current/static/plpgsql-structure.html
Jun
22
comment How to see list of databases in Oracle?
@DevYudh: a tablespace in Oracle is something completely different than a "database" in MySQL. The first query if correct, the second query is plain wrong
Jun
22
comment Pattern matching in PostgreSQL?
No it's not "mostly similar". The syntax is completely different between those three DBMS.