tool/scratch: add `distinct` select test

This commit is contained in:
Danny Robson 2024-03-04 11:42:52 +10:00
parent 43843a9c8b
commit e8d40f1fab
1 changed files with 2 additions and 5 deletions

View File

@ -155,7 +155,7 @@ static void test_conn (std::string_view display_name)
account.c.id == comment_.c.author_id
).where (
comment_.c.subreddit_id == subreddit_id
);
).distinct (account.c.id);
for (auto const &[id, name]: exec (conn, q))
fmt::print ("{}: {}\n", id, name);
@ -187,8 +187,7 @@ int main (int argc, char **)
auto const q = select (
func<"count">(subreddit.c.id + 9).cast<bigint> ().label<"foo"> (),
subreddit.c.display_name//,
//(link_.c.author_id + 1) / 1
subreddit.c.display_name
).join (
subreddit,
link_,
@ -199,8 +198,6 @@ int main (int argc, char **)
link_.c.author_id == argc
).where (
true
//).group_by (
// (link_.c.author_id + 1) / 1
);
//fmt::print (stdout, "query: {}\nresult: {}\n rendered: {}\n",