首页 > 解决方案 > 如何在 VSCODE 上调试 SQLite

问题描述

我正在尝试使用 SQLite 在 Vscode 上评估查询(见下文)。它返回一个错误,这不是很有帮助(见下文)。我想知道是否可以进行更深入的调试?老实说,我不确定如何开始调试。很多tks

代码:

WITH processed_users AS (
    SELECT
        LEFT (u.phone_country, 2) AS short_phone_country,
        u.id
    FROM
        users u
)
SELECT
    t.user_id,
    t.merchant_country,
    Sum (
        t.amount / fx.rate / Power (10, cd.exponent)
    ) AS amount
FROM
    transactions t
    JOIN fx_rates fx ON (
        fx.ccy = t.currency
        AND fx.base_ccy = 'EUR'
    )
    JOIN currency_details cd ON cd.currency = t.currency
    JOIN processed_users pu ON pu.id = t.user_id
WHERE
    t.source = 'GAIA'
    AND pu.short_phone_country = t.merchant_country
GROUP BY
    t.user_id,
    t.merchant_country
ORDER BY
    amount DESC;

错误:

[5:21:43 PM][vscode-sqlite][ERROR] near "(": syntax error

标签: sqlsqlitedebuggingvisual-studio-code

解决方案


推荐阅读