Twoim problemem jest to, że powszechną NICOŚĆ mylisz z osobistą PUSTKĄ
mysql>show databases;+--------------------+| Database |+--------------------+| information_schema || cwiczenia || magazyn || stan12 || zaoczni12 |+--------------------+5 rows in set (0.06 sec)mysql> use stan12;Database changedmysql> show tables;+------------------+| Tables_in_stan12 |+------------------+| LISTA || MIEJSCE || PUNKTY12GR || PUNKTY1GR || PUNKTY4GR || PUNKTY6GR || SEKCJE1MAP || SEKCJE6MAP || TYPGRANICY1 || TYPGRANICY6 || TabA || TabB || TabelaB || auta || drzewa || dzialki || facet || kobieta || lista || lista2 || miasta || miejsce || miejsce1 || pgrp1 || pgrp2 || punkty2gr || punktygr || punktygr_1 || punktygr_2 || punktygr_3 || punktygr_jd || sekcje2map || sekcjemap_1 || sekcjemap_2 || sekcjemap_3 || sekcjemap_jd || sm2 || tg1 || tg2 || typgranicy || typgranicy2 || typgranicy_1 || typgranicy_2 || typgranicy_jd || wlasciciele |+------------------+45 rows in set (0.06 sec)----------------------------------------------A----------------------------------------------mysql>create table pgrp2->(nr char(10) primary key,->x decimal(8,2) not null,->y decimal(8,2) not null,->dx decimal(8,2),->dy decimal(8,2),->typgr char(1) not null);----------------------------------------------1----------------------------------------------mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-1", 52232.55, 45222.25, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-2", 52298.98, 45252.55, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-3", 52298.98, 45252.55, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-4", 52298.98, 45252.55, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-5", 52298.98, 45252.55, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-6", 52302.00, 45299.99, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("15-1", 52332.00, 45401.05, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("15-2", 52378.55, 45477.09, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("12-7", 52400.00, 45500.05, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("15-3", 52410.05, 45501.05, "d");Query OK, 1 row affected (0.11 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("15-4", 52465.62, 45589.21, "d");Query OK, 1 row affected (0.09 sec)mysql> insert into pgrp2-> (nr, x, y, typgr)-> values ("15-5", 52475.62, 45705.21, "d");Query OK, 1 row affected (0.09 sec)----------------------------------------------2----------------------------------------------mysql> select * from pgrp2;+------+----------+----------+------+------+-------+| nr | x | y | dx | dy | typgr |+------+----------+----------+------+------+-------+| 12-1 | 52232.55 | 45222.25 | NULL | NULL | d || 12-2 | 52298.98 | 45252.55 | NULL | NULL | d || 12-3 | 52101.25 | 45013.68 | NULL | NULL | d || 12-4 | 52154.25 | 45115.15 | NULL | NULL | d || 12-5 | 52210.55 | 45215.15 | NULL | NULL | d || 12-6 | 52302.00 | 45299.99 | NULL | NULL | d || 12-7 | 52400.00 | 45500.05 | NULL | NULL | d || 15-1 | 52332.00 | 45401.05 | NULL | NULL | d || 15-2 | 52378.55 | 45477.09 | NULL | NULL | d || 15-3 | 52410.05 | 45501.05 | NULL | NULL | d || 15-4 | 52465.62 | 45589.21 | NULL | NULL | d || 15-5 | 52475.62 | 45705.21 | NULL | NULL | d |+------+----------+----------+------+------+-------+12 rows in set (0.05 sec)----------------------------------------------3----------------------------------------------mysql> select * from pgrp2 order by nr;+------+----------+----------+------+------+-------+| nr | x | y | dx | dy | typgr |+------+----------+----------+------+------+-------+| 12-1 | 52232.55 | 45222.25 | NULL | NULL | d || 12-2 | 52298.98 | 45252.55 | NULL | NULL | d || 12-3 | 52101.25 | 45013.68 | NULL | NULL | d || 12-4 | 52154.25 | 45115.15 | NULL | NULL | d || 12-5 | 52210.55 | 45215.15 | NULL | NULL | d || 12-6 | 52302.00 | 45299.99 | NULL | NULL | d || 12-7 | 52400.00 | 45500.05 | NULL | NULL | d || 15-1 | 52332.00 | 45401.05 | NULL | NULL | d || 15-2 | 52378.55 | 45477.09 | NULL | NULL | d || 15-3 | 52410.05 | 45501.05 | NULL | NULL | d || 15-4 | 52465.62 | 45589.21 | NULL | NULL | d || 15-5 | 52475.62 | 45705.21 | NULL | NULL | d |+------+----------+----------+------+------+-------+12 rows in set (0.47 sec)----------------------------------------------4----------------------------------------------mysql> select count(nr) from pgrp2;+-----------+| count(nr) |+-----------+| 12 |+-----------+1 row in set (0.04 sec)----------------------------------------------5----------------------------------------------mysql> select * from pgrp2 where typgr="d";+------+----------+----------+------+------+-------+------+| nr | x | y | dx | dy | typgr | sek |+------+----------+----------+------+------+-------+------+| 12-1 | 52232.55 | 45222.25 | NULL | NULL | d | 3 || 12-2 | 52298.98 | 45252.55 | NULL | NULL | d | 1 || 12-3 | 52101.25 | 45013.68 | NULL | NULL | d | 3 || 12-4 | 52154.25 | 45115.15 | NULL | NULL | d | 3 || 12-5 | 52210.55 | 45215.15 | NULL | NULL | d | 3 || 12-6 | 52302.00 | 45299.99 | NULL | NULL | d | 1 || 12-7 | 52400.00 | 45500.05 | NULL | NULL | d | 2 || 15-1 | 52332.00 | 45401.05 | NULL | NULL | d | 2 || 15-2 | 52378.55 | 45477.09 | NULL | NULL | d | 2 || 15-3 | 52410.05 | 45501.05 | NULL | NULL | d | 2 || 15-4 | 52465.62 | 45589.21 | NULL | NULL | d | 2 || 15-5 | 52475.62 | 45705.21 | NULL | NULL | d | 2 |+------+----------+----------+------+------+-------+------+12 rows in set (0.11 sec)----------------------------------------------B----------------------------------------------mysql> create table tg2-> (rg char(1) primary key,-> opis char(20)not null,-> kl int(1) not null);Query OK, 0 rows affected (0.17 sec)----------------------------------------------6----------------------------------------------mysql> insert into tg2-> (rg, opis, kl)-> values ("d", "granica dzia?ki", 6);Query OK, 1 row affected (0.11 sec)mysql> insert into tg2-> (rg, opis, kl)-> values ("o", "granica obr?bu", 5);Query OK, 1 row affected (0.09 sec)mysql> insert into tg2-> (rg, opis, kl)-> values ("g", "granica gminy", 4);Query OK, 1 row affected (0.09 sec)mysql> insert into tg2-> (rg, opis, kl)-> values ("p", "granica powiatu", 3);Query OK, 1 row affected (0.11 sec)mysql> insert into tg2-> (rg, opis, kl)-> values ("w", "granica wojew?dztwa", 2);Query OK, 1 row affected (0.11 sec)mysql> insert into tg2-> (rg, opis, kl)-> values ("k", "granica kraju", 1);Query OK, 1 row affected (0.11 sec)----------------------------------------------7----------------------------------------------mysql> select * from tg2;+------+---------------------+------+| rg | opis | kl |+------+---------------------+------+| d | granica dzia?ki | 6 || o | granica obr?bu | 5 || g | granica gminy | 4 || p | granica powiatu | 3 || w | granica wojew?dztwa | 2 || k | granica kraju | 1 |+------+---------------------+------+6 rows in set (0.06 sec)----------------------------------------------8----------------------------------------------mysql> select * from tg2 order by kl;+------+---------------------+------+| rg | opis | kl |+------+---------------------+------+| k | granica kraju | 1 || w | granica wojew?dztwa | 2 || p | granica powiatu | 3 || g | granica gminy | 4 || o | granica obr?bu | 5 || d | granica dzia?ki | 6 |+------+---------------------+------+6 rows in set (0.06 sec)----------------------------------------------9----------------------------------------------mysql> select * from pgrp2-> where typgr=(select rg from tg2-> where opis="granica dzia?ki");+------+----------+----------+------+------+-------+| nr | x | y | dx | dy | typgr |+------+----------+----------+------+------+-------+| 12-1 | 52232...