Axiverse
05-28-2009, 03:17 AM
can you guys help me with these two statements?
this doesn't work because i'm on mysql 4. are there any alternatives for it?
INSERT INTO tags (tag_word, tag_count)
VALUES ('apple', 1), ('orange', 1), ('blueberry', 1)
ON DUPLICATE KEY UPDATE tag_count = tag_count + 1
and i don't know why this one doesn't work. I've even written it in two different ways =(
UPDATE tags
SET tag_count = tag_count - 1
WHERE tag_identifier
IN ( SELECT tag_identifier
FROM dealtags
WHERE deal_identifier = 0)
or alternative
UPDATE strappt_tags
SET tag_count = tags.tag_count - 1
FROM tags, dealtags
WHERE dealtags.tag_identifier = tags.tag_identifier
AND deal_identifier = ?
thanks!
this doesn't work because i'm on mysql 4. are there any alternatives for it?
INSERT INTO tags (tag_word, tag_count)
VALUES ('apple', 1), ('orange', 1), ('blueberry', 1)
ON DUPLICATE KEY UPDATE tag_count = tag_count + 1
and i don't know why this one doesn't work. I've even written it in two different ways =(
UPDATE tags
SET tag_count = tag_count - 1
WHERE tag_identifier
IN ( SELECT tag_identifier
FROM dealtags
WHERE deal_identifier = 0)
or alternative
UPDATE strappt_tags
SET tag_count = tags.tag_count - 1
FROM tags, dealtags
WHERE dealtags.tag_identifier = tags.tag_identifier
AND deal_identifier = ?
thanks!