Question : I have a restore database script in a SQL file, and I’m trying to restore a backup generated […]
DbaFix
Wrong sharding on mongoDB 3.0
Question : I have a mongos with 2 shard servers (and 3 config servers) sh.status() — Sharding Status — sharding […]
how can I join two very different table structures? No common keys
Question : For the purpose of good database design, I’ve never run into an issue like this, but we are […]
How to get next value of Sequence dynamically in Oracle
Question : I used to a SQL guy and trying my hands on Oracle front. I am getting dynamic values […]
Given a table with date_time column, how to run a query using only the date
Question : I have a DB with a table which has a column datetime Date_Time. The format of this is […]
Postgresql: How to pass an array to trigger function in TG_ARGV?
Question : I’ve got some fairly generic Postgres trigger functions that I’d like to re-use across a few different tables. […]
How to efficiently create a new PRIMARY KEY CLUSTERED definition online
Question : Given a table with a PRIMARY KEY definition (acting as the clustered index), I want to efficiently change […]
What’s a good way of doing a > or < comparison that considers NULLs to be sorted first or last?
Question : I’m on Postgres 13.5. Records always have a number (type: integer) and optionally a single letter A-Z (type: […]
LEFT JOIN with WHERE (Microsoft Access SQL)
Question : Given following 2 tables a, b: table a ID job 1 farmer 2 physician 3 bank clerk table […]
How can I find under what context the job was invoked?
Question : The SQL job history message column says: The job succeeded. The job was invoked by Schedule 12…. If […]