Beruflich Dokumente
Kultur Dokumente
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [daaju]> select * from tbl_student where Sage > some (select Tage from
tbl_teacher where address="dhn");
ERROR 1054 (42S22): Unknown column 'Sage' in 'IN/ALL/ANY subquery'
MariaDB [daaju]> select * from tbl_student where Age > some (select Tage from
tbl_teacher where address="dhn");
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
+-----+---------+-------+------+-------+
2 rows in set (0.13 sec)
MariaDB [daaju]> select * from tbl_student where Age < some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age = some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age <= some (select Tage from
tbl_teacher where address="dhn");
Empty set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age >= some (select Tage from
tbl_teacher where address="dhn");
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
+-----+---------+-------+------+-------+
2 rows in set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age all > some (select Tage from
tbl_teacher where address="dhn");
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'all >
some (select Tage from tbl_teacher where address="dhn")' at line 1
MariaDB [daaju]> select * from tbl_student where Age >all (select Tage from
tbl_teacher where address="dhn");
+-----+---------+--------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+--------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
| 3 | ktm | rohit | 20 | 14000 |
| 4 | pkr | mohit | 24 | 17000 |
| 5 | dang | saugat | 22 | 11000 |
+-----+---------+--------+------+-------+
5 rows in set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age >all (select Tage from
tbl_teacher );
+-----+---------+--------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+--------+------+-------+
| 1 | dhn | ram | 23 | 12000 |
| 2 | dhn | hari | 21 | 17000 |
| 4 | pkr | mohit | 24 | 17000 |
| 5 | dang | saugat | 22 | 11000 |
+-----+---------+--------+------+-------+
4 rows in set (0.00 sec)
MariaDB [daaju]> select * from tbl_student where Age =all (select Tage from
tbl_teacher );
+-----+---------+-------+------+-------+
| Sid | Address | Sname | Age | Fee |
+-----+---------+-------+------+-------+
| 3 | ktm | rohit | 20 | 14000 |
+-----+---------+-------+------+-------+
1 row in set (0.00 sec)