合并并替换表id与两个表的名称SQL


Merge and replace table id with name of two table SQL

table customers:

+----+------------+
| id | text       |
+----+------------+
| 33 | name1      | 
| 34 | name2      | 
| 35 | name3      | 
| 36 | name4      | 
+----+------------+

表订单:

+----+--------+------------+----------+
| id |  cid   |  ordername |  colors  |
+----+--------+------------+----------+
|  8 |   34   |    name    |    5     |        
+----+--------+------------+----------+

有可能一次查询得到这个结果吗?

+----+--------+------------+----------+
| id |  cid   |  ordername |  colors  |
+----+--------+------------+----------+
|  8 | name1  |    name    |    5     |        
+----+--------+------------+----------+

怎么做

   select o.`id`, `text` as cid , `ordername`, `colors` from orders o
   inner join customers c
   on  c.id = o.cid 

演示

输出:

   ID   CID     ORDERNAME   COLORS
   8    name2   name              5