From 58f82feb08cc714d4defd5d05a2f461d9d432af5 Mon Sep 17 00:00:00 2001 From: Jeffrey Elkner Date: Fri, 28 Apr 2023 12:33:22 +0100 Subject: [PATCH] Add many-to-many quotes to category join --- scripts/.create_tables.sql.swp | Bin 0 -> 12288 bytes scripts/select_quote_cats.sql | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 scripts/.create_tables.sql.swp create mode 100644 scripts/select_quote_cats.sql diff --git a/scripts/.create_tables.sql.swp b/scripts/.create_tables.sql.swp new file mode 100644 index 0000000000000000000000000000000000000000..e1887957407b24e1ab9eeaec2d73114581bfc142 GIT binary patch literal 12288 zcmeI2zi-n(6vtmXfz(n&7Z#*zSW>BK%C7-M46bvD4jQM}F0=zej(vqlX>x+Z-Zw%&ziFxpd2?k&Q24DaNU;qYS00v+H24DaNU|W#)wI z{9wK@ADM{hF%4_xffI}lB6vipewB^|WG9{3WPa%K@UY#UcU08K zdpJCO9F?4z(JKx@HM_MtFstf9?kmT2L}@6cBuv9Gjhd|fCopepW>isZX4sjpb}V{Z RHk2h?+prwNbXCi$(my?3=s*Af literal 0 HcmV?d00001 diff --git a/scripts/select_quote_cats.sql b/scripts/select_quote_cats.sql new file mode 100644 index 0000000..e42318e --- /dev/null +++ b/scripts/select_quote_cats.sql @@ -0,0 +1,7 @@ +\echo JOIN quotes TO categories: +SELECT LEFT(qtext, 50) AS "Quote", description AS "Category" +FROM quote +JOIN quotecategory +ON quote.qid = quotecategory.qid +JOIN category +ON quotecategory.cid = category.cid;