How to do subquery within SELECT list without joining table? #269
Answered
by
houtn11
jamesleeht
asked this question in
Q&A
-
I've looked into the subquery part of the wiki and tried a bunch of things but unable to achieve something similar to this:
Is there any way to achieve something like this? (Select within the select, rather than joining the table before selecting) I tried this:
However, placing this Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Answered by
houtn11
Aug 25, 2023
Replies: 1 comment 1 reply
-
stmt := SELECT(
Car.Name,
SELECT(
COUNT(STAR),
).FROM(
CarLike,
).WHERE(
CarLike.CarID = Car.ID,
).AS("like_count")
).FROM(
Car,
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jamesleeht
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AsTable
is used only for the sub-queries in theFROM
clause.