Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
CREATE VIEW hpvwOutgoingPN AS
SELECT
recipient,
message
FROM pn
WHERE sender='hpvw';
INSERT INTO hpvwOutgoingPN set
recipient='Romsl',
message='Hello';
sender recipient message
hpvw Romsl Hello
mysql> select * from pn;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 2 | hans | otto | hello otto |
| 3 | otto | marc | hello marc |
+----+--------+----------+------------+
2 rows in set (0.01 sec)
mysql> create view ottoOut as
-> select * from pn
-> where sender='otto'
-> with check option;
Query OK, 0 rows affected (0.00 sec)
mysql> create view ottoIn as
-> select * from pn
-> where reciever='otto'
-> with check option;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from ottoOut;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 3 | otto | marc | hello marc |
+----+--------+----------+------------+
1 row in set (0.00 sec)
mysql> select * from ottoIn;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 2 | hans | otto | hello otto |
+----+--------+----------+------------+
1 row in set (0.01 sec)
mysql> insert into ottoOut set
-> sender='otto',
-> reciever='hans',
-> message='hello hans';
Query OK, 1 row affected (0.41 sec)
mysql> insert into ottoOut set
-> sender='hans',
-> reciever='marc',
-> message='hello marc';
ERROR 1369 (HY000): CHECK OPTION failed 'pn.ottoout'
mysql> select * from pn;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 2 | hans | otto | hello otto |
| 3 | otto | marc | hello marc |
| 4 | otto | hans | hello hans |
+----+--------+----------+------------+
3 rows in set (0.00 sec)
mysql> select * from ottoOut;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 3 | otto | marc | hello marc |
| 4 | otto | hans | hello hans |
+----+--------+----------+------------+
2 rows in set (0.01 sec)
mysql> select * from ottoIn;
+----+--------+----------+------------+
| id | sender | reciever | message |
+----+--------+----------+------------+
| 2 | hans | otto | hello otto |
+----+--------+----------+------------+
1 row in set (0.00 sec)
Da hast Du schon wieder Recht. Vielleicht findet ja einer der Mods einen eleganten Weg, das Thema zu teilen oder kann es verschieben.Romsl hat gesagt.:Vielleicht sollte man das ganze mal im DB Forum behandeln.