【问题标题】:how to index (or view ) two tables in mysql?如何索引(或查看)mysql 中的两个表?
【发布时间】:2016-03-26 20:01:57
【问题描述】:
aid  |  name                   udi | aid | name | description
------------------------      -------------------------
1       text                   1     1      text     text

我想将这些表合并到一个表中(实时更新)

如何使用这样的索引来做到这一点:

aid | aname |  uid | uname | udescription

【问题讨论】:

  • create view . . . from t1 join t2 on t1.aid = t2.aid.

标签: mysql sql join indexing view


【解决方案1】:
Create view YOURviewName as   

select
a.aid,
a.name as aname,
u.aid as uid,
u.name as uname,
u.description as udescription
from
a inner join u on a.aid = u.aid

【讨论】:

    猜你喜欢
    • 2011-07-09
    • 1970-01-01
    • 1970-01-01
    • 2012-04-08
    • 1970-01-01
    • 2013-10-30
    • 2011-05-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多