angeloghiotto Posted September 20, 2011 Share Posted September 20, 2011 MySQL version 5.1.56 heelo, i want to merge two identical tables without get the duplicate values, and.. if a duplicate appears i want to plus 1 to the hit column... that's possible?! Like: Table 1 Columns : A - B Values: Hi - 0 Values: Hello - 0 Table 2 Columns : A - B Values: Hi - 0 Values: Nice - 0 New Table 3 Columns : A - B Values: Hi - 1 Values: Nice - 0 Values: Hello - 0 . Understand? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/247503-mage-a-table-without-getting-the-duplicates-and-anothers-functions/ Share on other sites More sharing options...
Muddy_Funster Posted September 20, 2011 Share Posted September 20, 2011 not with the information that you have given I don't think. There may be a couple of methods that will get the results that you are looking for, but we will need to know exactly what you are doing. Are you creating a new table? could you provide your actual table structure for the database that you are working on? Link to comment https://forums.phpfreaks.com/topic/247503-mage-a-table-without-getting-the-duplicates-and-anothers-functions/#findComment-1271006 Share on other sites More sharing options...
angeloghiotto Posted September 26, 2011 Author Share Posted September 26, 2011 Yes, i'm creating a new table. Table structure: ( the both table have the same structure... ) Uploaded with ImageShack.us Link to comment https://forums.phpfreaks.com/topic/247503-mage-a-table-without-getting-the-duplicates-and-anothers-functions/#findComment-1272744 Share on other sites More sharing options...
fenway Posted September 26, 2011 Share Posted September 26, 2011 That's what INSERT... ON DUPLICATE KEY UPDATE... is for. Link to comment https://forums.phpfreaks.com/topic/247503-mage-a-table-without-getting-the-duplicates-and-anothers-functions/#findComment-1272868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.