Question : Hi DBA Stack Exchange! Today I tried Apex SQL Refactor and right from the get go, once installed […]
Tag: query-refactor
Are these two queries logically equivalent?
Question : Are these two queries logically equivalent? DECLARE @DateTime DATETIME = GETDATE() Query 1 SELECT * FROM MyTable WHERE […]
How can I optimize this query and support multiple SKUs?
Question : My current query only can select one SKU at a time. I can leave salesite_id constant. If there […]
Refactoring a very large database table and having join over millions of records
Question : I have a fairly big postgresql jobs table of (more than 60 attributes) and one critical query contains […]
How can I optimize this query and support multiple SKUs?
Question : My current query only can select one SKU at a time. I can leave salesite_id constant. If there […]
Refactoring database after migrating table
Question : I’m creating a new staging database, into which I intend to migrate several tables from the old database. […]
Optimize Query with Derived Table
Question : I have the following query select ps.id, ps.title , IFNULL(s.likes,0) as num_likes , IFNULL(s.comments,0) as num_comments , IFNULL(s.ratings,0) […]
PostgreSQL Query Refactoring
Question : I have a simple table called events It has a date, start time, end time and status I […]
Are these two queries logically equivalent?
Question : Are these two queries logically equivalent? DECLARE @DateTime DATETIME = GETDATE() Query 1 SELECT * FROM MyTable WHERE […]
Alternative query to this (avoid DISTINCT)
Question : Note: I work with MSSQL 2008, but I guess it’s valid for many others DB engines I have […]
- 1
- 2