Q:

Query CREATE VIEW multiple tables into one table the mysql php

How do I name four tables Make a single table
Name table = (ID), (post_title)
sku table = (meta_id), (post_id), (meta_key), (meta_value)
Price table = (meta_id), (post_id), (meta_key), (meta_value)
stock table = (meta_id), (post_id), (meta_key), (meta_value)

This query failed
CREATE VIEW fortress AS
SELECT name.ID, name.post_title, price.meta_value, sku.meta_value, stock.meta_value
FROM name
INNER JOIN price ON (name.ID = price.meta_id)
INNER JOIN key ON (name.ID = sku.meta_id)
INNER JOIN stock ON (name.ID = stock.meta_id)

This error occurred

1060 - Duplicate column name 'meta_value'

What is your solution?

A:

You need to give aliases to columns with duplicate names:
Example:
CREATE VIEW fortress AS
SELECT name.ID, name.post_title, price.meta_value AS price_meta_value, 
       key.meta_value AS key_meta_value, stock.meta_value AS AS stock_meta_value
FROM name`enter code here`
INNER JOIN price ON (name.ID = price.meta_id)
INNER JOIN key ON (name.ID = s.k.u.meta_id)
INNER JOIN stock ON (name.ID = stock.meta_id)

