MySQL:当前选择不包含唯一列.网格编辑,复选框,编辑,复制和删除功能不可用 [英] MySQL: Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available

查看:795
本文介绍了MySQL:当前选择不包含唯一列.网格编辑,复选框,编辑,复制和删除功能不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关我的问题的所有帖子.但是没有什么能解决这个问题.

I have read all the posts regarding my issue in SO. But nothing fixed this.

问题: 当运行提到的查询时,出现以下警告.

Issue: When runs the mentioned query, below warning appears.

当前选择不包含唯一列.网格编辑,复选框,编辑,复制和删除功能不可用.

Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

下面是我的查询.

SELECT ST.stock_code, S.supplier_name, I.item_name, P.avail_qty, SL.unit_price, P.expire_date 
FROM purchase_items P 
INNER JOIN stock ST ON P.stock_id = ST.stock_id 
INNER JOIN suppliers S ON ST.sup_id = S.sup_id 
INNER JOIN items I ON P.item_id = I.item_id 
INNER JOIN sales SL ON P.item_id = SL.item_id 
WHERE (P.expire_date > (NOW() + INTERVAL 1 MONTH))

purchase_items表

推荐答案

当我使用VIEW时,我遇到了同样的问题,看起来它是phpmyadmin,只是无法证明结果查询中是否存在表设计唯一的列.在您的情况下,它是stock_id,但是由于存在多个表联接,而在其他行中不存在stock_id,因此无法忽略收缩的行在编辑或删除时受到影响. 可以通过配置禁用此警告

I faced same problem when I use VIEW and looks like it's phpmyadmin just can't prove that there are columns in resulting query that unique by table design. In your case it's stock_id, but since there is multiple table join and stock_id is not present in other rows it is unable to deside what row shoild be affected on edit or delete. This warning could be disabled via config

$cfg['RowActionLinksWithoutUnique'] = true

https://docs.phpmyadmin.net/en/latest/config .html#cfg_RowActionLinksWithoutUnique

解决方案:此表不包含唯一列.网格编辑,复选框,编辑,复制和删除功能不可用

这篇关于MySQL:当前选择不包含唯一列.网格编辑,复选框,编辑,复制和删除功能不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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