Blog
Guides & Tutorials
Step-by-step articles on MCP servers, AI + database integrations, and more.
Why Your AI's OR Filter Returns Way Too Many Rows
Asked for paid orders in the US and got every paid order on earth plus a pile of unpaid US ones. AND binds tighter than OR — without parentheses, the filter you said is not the filter that ran.
September 5, 2026
Why Your AI's 'Latest Order Per Customer' Picks the Wrong Row
Asked for each customer's most recent order and got the latest date — attached to the wrong amount or status. GROUP BY + MAX(date) then joining back on date alone matches every order that shares that timestamp, or a different order entirely.
September 5, 2026
Why Your AI's Revenue Total Is Off by a Few Cents
Asked for total revenue and got $10,000.02 instead of $10,000.00 — or a percentage that doesn't quite reconcile. Money stored as FLOAT/DOUBLE can't represent cents exactly. SUM then makes the error visible.
September 5, 2026
Why Your AI's COUNT Is Lower Than the Number of Rows
Asked how many customers you have and got a lower number than the table actually has. COUNT(column) skips NULL values in that column — COUNT(*) does not. Same table, two different counts, no error.
September 1, 2026
Why Your AI's Page 2 Is Missing Rows (or Showing Duplicates)
Asked for page 2 of recent signups and some names from page 1 reappeared — or a row vanished between pages. OFFSET/LIMIT without a unique ORDER BY is not a stable page. New inserts and ties both shuffle what 'next 50' means.
September 1, 2026
Why Your AI's ID Filter Misses Rows (or Errors) Across Databases
Asked for customer 00123 and got no row — or a Postgres error about comparing text to integer. IDs stored as VARCHAR don't compare the way integers do. Leading zeros, implicit casts, and three databases that disagree.
September 1, 2026
Why Your AI's Percentage Calculation Comes Back as 0
Asked for a conversion rate or percentage and got 0% back for something you know isn't zero. In Postgres and SQL Server, dividing an integer by an integer truncates to a whole number — 3 divided by 10 is 0, not 0.3. MySQL doesn't have this problem, which makes it worse to debug.
August 29, 2026
Why Your AI's LEFT JOIN Quietly Becomes an INNER JOIN
Asked for 'all customers and their orders, including customers with none' — got back only customers who have orders. A LEFT JOIN with a filter on the right-hand table sitting in WHERE instead of ON silently defeats the whole point of the LEFT JOIN.
August 29, 2026
Why Your AI's Date Range Query Misses the Last Day
Asked for 'orders in August' and August 31st is missing, even though rows clearly exist for that day. BETWEEN '2026-08-01' AND '2026-08-31' on a timestamp column means up to midnight on the 31st — not through the end of the day.
August 26, 2026
Why Your AI's Boolean Filter Fails Across Databases
WHERE is_active = true works in Postgres and throws a syntax error in SQL Server, where the same column is really a BIT and needs = 1. MySQL's BOOLEAN is secretly a TINYINT too. Why 'true' and 'false' aren't universal SQL, and what to ask for instead.
August 26, 2026