Blog
Guides & Tutorials
Step-by-step articles on MCP servers, AI + database integrations, and more. — Page 3
Why Your AI's Combined List Is Missing Rows You Know Exist
Asked to combine two lists — trial signups and paid signups — and a person who is in both vanished. UNION removes duplicates. UNION ALL keeps every row. The model often picks UNION because it sounds cleaner.
September 12, 2026
Why Your AI's Full Name Comes Back Blank
Asked for first name + last name and got NULL whenever one side was missing. In Postgres and SQL Server, string concatenation with NULL makes the whole result NULL. MySQL CONCAT skips NULLs instead — same request, different blank.
September 6, 2026
Why Your AI's 'Missing Email' Count Ignores Blank Emails
Asked how many customers have no email and got only the NULL rows. Forms often save '' instead of NULL. IS NULL does not match empty strings — and the two are not interchangeable across Postgres, MySQL, and Oracle-style installs.
September 6, 2026
Why Your AI's Search for '100%' Matches Almost Everything
Asked for products named 100% and got every row. In LIKE, % means 'anything' and _ means 'any one character.' A user string pasted into LIKE without escaping is not a literal search.
September 6, 2026
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