user1363989
  • Member for 7 years, 10 months
  • Last seen more than 1 year ago
How to find the rows from a table which has exactly two 'n' s in the employee name?
Accepted answer
3 votes

something like this should be enough: select * from employee_table where Length(lastname) - length(replace(lastname, 'n','')) = 2 be aware that may cause a full table scan :-)

View answer
select rows where timestamp is a multiple of n seconds
Accepted answer
2 votes

something like select * from table where MOD(UNIX_TIMESTAMP(timestamp),300)) = 0; should do the job. But I am not sure if this is correct. The idea is to try to modulo divide the minute part ...

View answer
Help me improve my query
2 votes

A very fast shot: do you need the sorting? Especially in your getUpdatedAgentGroup function? This may can be a quickfix. Another issue are indexes, have you them in place?

View answer
NVL v/s Check IS NULL
Accepted answer
1 votes

I'm not sure why nvl should be better than is null, except it is an oracle function(not available on other dbms). I've also preferred is null over nvl on oracle; I would not use nvl because it's a ...

View answer
using update query with subquery in Oracle sql
1 votes

I would recommend to have a look into the merge into statement when youre deailing with oracle. if you just want to update rows omit when not matched part of the statement see http://www.oracle.com/...

View answer
Replacing the results of a row
Accepted answer
1 votes

what you can do, is to write two stored procedures with the following logic: Build a stored procedure which does the case thing. This may be optional but the resulting sql would look better and ...

View answer
Is SQL Server Thread Safe?
1 votes

From the database perspective, this can be configured with isolation levels. Be aware that every isolation has some scenarios which can be solved but also with a certain impact. I think the wikipedia ...

View answer
To replicate, or not to replicate
1 votes

Replication is always tricky. If you can, avoid it as long as possible. You have to keep in mind that you have to setup a multimaster cluster which complicates things a lot. We've tried mysql ...

View answer
SQL Server query
0 votes

written from the head, maybe this will help ya -- extract group Names from table with groups as ( select grpName from table group by grpName ) select maschineName, string_agg(grpName,',') as ...

View answer
Postgres: error message "does not exist" when dropping existing trigger
0 votes

Remove the "" - so it will be case insensitive. Please also remove the "" when creating the trigger.

View answer
Order of output row in random order
0 votes

You cannot predict the order of a query. Even though when the query is only reading one table. This has to dowith several factors like vacuuming or used indexes. Always think in sets with databases.

View answer