MySQL Query with Multiple Tables

后端 未结 3 1936
遥遥无期
遥遥无期 2021-01-21 02:16
Table: UserInfoTbl
=======================
| username  | type    |
=======================
| user0001  | premium |
| user0002  | premium |
| user0003  | normal  |
| user         


        
3条回答
  •  猫巷女王i
    2021-01-21 02:54

    DroidMatt can you clarify what the 2 tables relationship are

    UserInfoTbl.username = UserPvTbl.fusername
    or
    UserInfoTbl.username = UserPvTbl.username

    Vikram is right assuming the first. otherwise you want this.

    SELECT *
    FROM UserInfoTbl, UserPvTbl
    WHERE UserPvTbl.username = UserInfoTbl.username
    AND UserPvTbl.username = 'user0003'
    

提交回复
热议问题