GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

INSERT INTO ... SELECT ... ON DUPLICATE KEY UPDATE

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • INSERT INTO ... SELECT ... ON DUPLICATE KEY UPDATE

    Hi.

    I want to archive a table contains search strings and results.
    I just want to sum the data like this:

    INSERT INTO video_search_query_log_archive (query_string, query_string_count, result_count_sum)(SELECT query_string, COUNT(query_string) AS qsc, SUM(result_count) AS rcFROM video_search_query_logGROUP BY query_string)ON DUPLICATE KEY UPDATE query_string_count = qsc, result_count_sum = rc


    Bu its not working, anyone can tell me how to make it work?!
Working...
X