查询允许用户仅查看其产品 [英] query for permit the user to only looks at his product

查看:67
本文介绍了查询允许用户仅查看其产品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,用于包含itemid,itemname的项目,另一个用于权限,其中包含userid,itemid.现在,我只想向用户显示那些在用户权限中已授予他许可的产品.它在userlogin和userid上存储在Session中.

I have one table for items which contain itemid,itemname , another for permission which contain userid,itemid. Now i want to show the user only those products whose permission given to him in the userpermission. Its on the userlogin and userid is stored in Session .

推荐答案

我假设您需要sql部分

I assume you need the sql part

SELECT
    *
FROM 
    Item_Table it
JOIN
    Permission_Table pt
ON
    it.itemid = pt.itemid
WHERE
    pt.userid = @userId


这篇关于查询允许用户仅查看其产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆