13,907 reputation
12253
bio website
location Munich, Bavaria
age
visits member for 3 years, 10 months
seen 1 hour ago

Feb
26
comment Should I normalize my string arrays, or just keep it a simple string?
You might want to look into Postgres' hstore data type. A very efficient (indexable!) key/value store. Plus it has index types that efficiently support like '%ab%'
Feb
26
comment Should I normalize my string arrays, or just keep it a simple string?
Which DBMS are you using? Postgres? Oracle?
Feb
24
comment How to modelling a union type in PostgreSQL
"9.x" covers four different major versions (and in fact is the only "version" that is still maintained)
Feb
22
comment Left outer join to itself to find outliers?
Which DBMS are you using? Postgres? Oracle?
Feb
20
comment Postgres Index a query with MAX and groupBy
wiki.postgresql.org/wiki/Slow_Query_Questions
Feb
19
comment SQL Server's aggregate functions ignore nulls. How do I correct this?
@AndriyM: good point, I added that as well. Thanks
Feb
18
comment Tuning PostgreSQL for minimum reliability and bulk updates
Use an unlogged table and turn off fsync. You might also want to show us the execution plan of the update statement (wiki.postgresql.org/wiki/Slow_Query_Questions)
Feb
18
comment Some data is missing in the table of SQL
I would guess this is caused by your SQL client not displaying all the data. Which SQL client are you using? Maybe check the manual to see if there is a max. display length somewhere in the options.
Feb
18
comment Is it possible to backup and restore a materialized view with it's data?
You could use copy to create an plain text dump of the data (or any other export utility). Not sure how to restore it though.
Feb
17
comment How to create counter for table column (not id) which reset to 1 every month?
Create a cron job that runs that statement every month
Feb
17
comment psql: how to turn off context messages at raise notice
I think it's controlled by log_error_verbosity Try set log_error_verbosity=DEFAULT
Feb
16
comment Query optimization and takes less execution time
Please add the tag for the DBMS you are using (Postgres, Oracle, ..) If you are using Postgres, please add the output of explain analyze select ... for both queries. But for any modern DBMS I would assume that both queries are executed in absolutely the same way by the database.
Feb
11
comment PostgreSQL plpgsql math increment a DECLARE to fix table sequence
SELECT (PKEY + 1) INTO PKEY_NUMBER ... won't work because Pkey is variable and not a column name.
Feb
11
comment PostgreSQL plpgsql math increment a DECLARE to fix table sequence
You can do this in a single statement: select setval('parts1_id_seq', (select max(pkey) + 1 from parts))
Feb
11
comment Use Oracle on Web App (New Question)
"HTML" can not connect to anything. It's a static markup language. You will need PHP, JSP/Java (or something similar) if you want a web application that displays data from a database in the browser. That question is however far too broad
Feb
11
comment Use Oracle on Web App (New Question)
So why did you install MySQL amd phpMyAdmin then? phpMyAdmin is only for MySQL
Feb
11
comment Use Oracle on Web App (New Question)
I don't get it: do you want to use Oracle or MySQL?
Feb
11
comment Combining date and date/time ranges in PostgreSQL
I would go for the third option as well
Feb
11
comment check key if exists in other table without fk constraint
If your trigger raises an exception, the insert won't happen (and the insert will fail with an error). If you want the insert to fail "silently" just return null from the trigger: "Row-level triggers fired BEFORE can return null to signal the trigger manager to skip the rest of the operation for this row"
Feb
10
comment How to add entries to tables in PostgreSQL if the attributes are reliant on other tables?
The groupid in group leaders is not necessary. And unless a group leader has additional attributes that a user does not have, I don't see the reason for the group leaders table at all. If the group leader is "just a user", let leaderID reference the users table.