Xeel
August 8th, 2008, 12:26 PM
Sup ;)
Ok, this is an update. I've got my question answered. But let's do a quiz from this.
Let's say you have two similar tables. In one we save text keys, the other is for saving text keys we can't use. Id fields are just to access our key easily in the future. All text keys are unique.
table#1 (registered keys):
+-------+-------------+
| idKey | varchar(12) |
+-------+-------------+
| txKey | varchar(15) |
+-------+-------------+
table#2 (blacklisted keys):
+-------+-------------+
| idKey | varchar(12) |
+-------+-------------+
| txKey | varchar(15) |
+-------+-------------+
So we want to create a new text key. And before we can save it we need to know if there is any key with the same name that already exists (to avoid duplication), and if it's one of the blacklisted keys.
Question: How it's done in one query?
Ok, this is an update. I've got my question answered. But let's do a quiz from this.
Let's say you have two similar tables. In one we save text keys, the other is for saving text keys we can't use. Id fields are just to access our key easily in the future. All text keys are unique.
table#1 (registered keys):
+-------+-------------+
| idKey | varchar(12) |
+-------+-------------+
| txKey | varchar(15) |
+-------+-------------+
table#2 (blacklisted keys):
+-------+-------------+
| idKey | varchar(12) |
+-------+-------------+
| txKey | varchar(15) |
+-------+-------------+
So we want to create a new text key. And before we can save it we need to know if there is any key with the same name that already exists (to avoid duplication), and if it's one of the blacklisted keys.
Question: How it's done in one query?