Can such a sample be made?

  • 0
    There is a table of goods and a table of aliases. They are finally not connected in any way. Aliases are somehow matched by cms and display information about the product.
    Alias ‚Äč‚Äčtable:


    Products table:


    Here, as you can see in the aliases, there is a column in which strings like product_id = 3000460 are a link to the product, there is also a CNC.

    The only problem is that these tables are not linked by any keys, so I would have done everything.

    I actually need to somehow make a selection from two tables so that I can display the name of the product and its alias, but I don't understand how to do this. Can it be possible to do this in non-standard mysql ways?
    MySQL Anonymous, Apr 6, 2019

  • 2 Answers
  • 0
    FROM `alias`
    JOIN `items` ON `items`.`product_id` = SUBSTR(`alias`.`field2`, 12)


    For MySQL 5.7.6 and higher, you can add to the alias table computed field with `product_id`
    Anonymous

  • 0

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!