Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我要做的是连接table1中的用户ID以连接table2中的用户名。而不是在页面上显示他的用户名。减少冗余。
谁能带我上路?
用于跨表将数据绑定在一起的SQL 连接适用于这种情况。语法将类似于以下内容:
select username from table1 join table2 on table1.userId = table2.userId