Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Gary,

1. A subselect should only have one value (one row, one field).
2. If you will connect to the current row of the outer select, the
table of the outer select must have an alias.

SELECT "event_name", "first_name", "middle_initial", "last_name",
"sex", "age", "email", "place",
  CASE
    WHEN "age" BETWEEN 0 AND 18  THEN 'Youth'
    WHEN "age" BETWEEN 19 AND 59 THEN 'Adult'
    ELSE 'Senior'
  END "Group",
  CASE
    WHEN "place" <= 3 THEN ( SELECT "finish" FROM "Ribbons"
WHERE "ID" = "a"."place" )
    WHEN "place" >= 4 THEN ( SELECT "finish" FROM "Ribbons"
WHERE "ID" = "4" )
  END "Finish",
  CASE
    WHEN "place" <= 3 THEN ( SELECT "ribbon" FROM "Ribbons"
WHERE "ID" = "a"."place" )
    WHEN "place" >= 4 THEN ( SELECT "ribbon" FROM "Ribbons"
WHERE "ID" = "4" )
  END "Ribbon"
FROM "Results" AS "a"

... would work.

Regards

Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJX/PhbAAoJELDKYwaoS9AI7CQQALCwbj3eMS15dglMvFrV9wK+
+DEj4O3MAR2q77g+Jfg6mRpJOzWOO6VPKDWcSLkJ8fE1PMEtRyeDgwohWDNjdTHI
o2WESahYWWBdQsAS2eo7w1CneFdIeqWVmH4Vm5zDeWyar904ys9Zb7RndV5a6IG6
NVR5i6tqCySTh7EjGQYWswOduK5HMQRDyh1dlV7cVlUlE/hAhumiHaTbdVs1z1wK
ltBmH/h5/Y7ScHzlkRCcF6pN5VnkGi20yVnRDjohqIQy8XZlmncaZLJp/DaG1U1z
2OqlGxdNTH3gY2Eoq1Fl/31WwAPvJwuxb0OMAMkucJBJv0cOFaUOkPcmSaKBoz1h
CPMiCskMC8DDlfnl3CxIW1jSMr0h5jGyj6WtGRRznqbhdqzIPcCiSRQNzL7Vmgmr
8VVJ9wCa2fEhHqPtbWSLDCj3rBD4iqyIbXje8Esc6FTwpzNUWE2BzdDC1fSuIJry
j/555xEdZ+FhT5UGbm0d37WLB5OxxUtW4UsnPsn7CcgkQQfChrD+c6FqEe+pj1Nt
aqfTVCSPTrTE6zX8mLbKlsweORVjc7Q0uelZuvhvGNJw1E+hJsuV0BLEe1pMpdna
Lbz7R7iGWGSn9NXsU+gwNGhAhzRj/a5Ir7oUOlxnFT/CzDM5pmouFFPBc026TOHL
YCIIbJculj0cp0LZObxj
=LO8G
-----END PGP SIGNATURE-----

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.