1

this is an example, it's similar to my project

i have two tables no link between Table1 and Table2.
TABLE1

    id! LIST(string)!             FNAME!       lNAME ! postalcode! country!
    1!  (FNAME lNAME, postalCode) ! fname1!   lname1! 02116!       USA!
    2!  (FNAME lNAME, postalCode) ! fname2!   lname2! 90210!       USA! 
    3!  (FNAME lNAME)             ! fname3!   lname3! 75000!       FR!
    4!  (FNAME lNAME)             ! fname4!   lname4! 13000!       FR!
    5!  (FNAME postalCode)        ! fname5!   lname5! 41000!       DE!

ect...

TABLE2.NAME Contains all the elements of the TABLE1

    NAME!  NAMEOCDE!
    02116! 10!
    90210! 11!
    75000! 12!
    13000! 13!
    41000! 14!
    fname1! 15!
    fname2! 16!
    fname3! 17!
    fname4! 18!
    fname5! 17!
    lname1! 19!
    lname2! 20!
    lname3! 21!
   lname4! 22!
  lname5! 23!
ect...

I want to replace Table1.LIST by TABLE2.NAMECODE
CAN I DO THIS BY:

  • Query whitout trigger or procedure
  • Any solution with mysql I have already done with PHP
  • Join theses tables

Note :
The Table1.LIST may be different
The Table1 contains a lot of columns
Table1.LIST is the same for each country thanks

  • Is there any link between Table1 and Table2? – Darshan Mehta Jan 21 '17 at 12:36
  • There is no any link between these 2 tables but all the data of table1 are in table 2 –  Jan 21 '17 at 12:50
  • It would be possible to do this if list was the same for all - but since mysql does not have split string function then a procedure would be necessary. – P.Salmon Jan 21 '17 at 14:43
  • to P.Salmon: If the list is the same for each country I have update my question –  Jan 21 '17 at 15:18

0 Answers0