我正在尝试编写一个简单的查询来获取特定表的所有列,但也会添加相关表中的行数。
以下是查询:
if lsvg -l appvg | awk 'NR > 2 && $3 != $4 { exit 1 } END {exit 0}'; then
echo "Columns matched in each line"
else
echo "Columns were different in some lines"
fi
这是错误:
SELECT
todos.*,
(SELECT COUNT(assets.*) FROM assets WHERE assets.parent_id = todos._id) AS asset_count
FROM todos
答案 0 :(得分:2)
尝试替换COUNT(assets.*)
或COUNT(*)
COUNT(assets._id)
我的第二个建议,尝试运行内部选择就像一个
SELECT COUNT(*) FROM assets WHERE assets.parent_id = 1 <-- any _id you have