#1001

Compare Number to Number

The order filter searches for user_id = 2, but the value was passed as text, preventing the fast path on numeric user_id. Rewrite the condition so user_id is compared to the number 2, keeping sorting by id.

Original query
SELECT * FROM orders WHERE user_id = '2' ORDER BY id

Ukážka očakávaného výstupu

Takto vyzerá správna odpoveď — počet riadkov je jej vlastný, nemusí sa zhodovať s tabuľkami schémy.

idstatususer_idcreated_at
12paid22024-02-04T09:00:00
15pending22024-02-07T11:00:00

Tu sa zobrazí výsledok vášho dotazu