Mercurial > hg > tema
view dist/biotopes/biotope.sql @ 1:548a93c24e55 release_0_1jk
Tema 0.1jk - Javakonkurs edition (imported from CVS).
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Thu, 14 Dec 2006 23:22:05 +0300 |
parents | 1d2fe61a3a62 |
children |
line wrap: on
line source
SELECT t1.*, (SELECT t2.rusname FROM biotopelist AS t2 WHERE Left(t2.rangcode, 1) = Left(t1.rangcode, 1) AND Right(t2.rangcode, 8) = '00000000' AND Right(t1.rangcode, 8) <> '00000000') AS class0, (SELECT t2.rusname FROM biotopelist AS t2 WHERE Left(t2.rangcode, 3) = Left(t1.rangcode, 3) AND Right(t2.rangcode, 6) = '000000' AND Right(t1.rangcode, 6) <> '000000') AS class1, (SELECT t2.rusname FROM biotopelist AS t2 WHERE Left(t2.rangcode, 5) = Left(t1.rangcode, 5) AND Right(t2.rangcode, 4) = '0000' AND Right(t1.rangcode, 4) <> '0000') AS class2, (SELECT t2.rusname FROM biotopelist AS t2 WHERE Left(t2.rangcode, 7) = Left(t1.rangcode, 7) AND Right(t2.rangcode, 2) = '00' AND Right(t1.rangcode, 2) <> '00') AS class3 FROM biotopelist AS t1 WHERE rusname