Mysql查询获取select perticulare列 [英] Mysql query to get select perticulare column

查看:118
本文介绍了Mysql查询获取select perticulare列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表包含以下列



Id,imagename,countRate



有很多表中包含不同imagesname的行。



所有图像显示在前端,点击按钮后每个图像增加该图像的countRate。我的困难是,我怎么知道任何perticulare countRate是受尊重的imageName。在where where子句中我应该提到什么,因为Id不为我所知。



我尝试了什么:



我有一张桌子包含以下栏目



Id,imagename,countRate



表中有许多行包含不同的imagesname。



所有图像显示在前端,点击按钮后每个图像增加该图像的countRate。我的困难是,我怎么知道任何perticulare countRate是受尊重的imageName。在where子句中我应该提到什么,因为我不知道Id。

I have one table contain following columns

Id,imagename,countRate

there are many rows in table containing different imagesname.

those all images are shown into the front end, after clicking on button with each image increment the countRate of that image. My difficulty is that how can I know that any perticulare countRate is for respected imageName. in where clause what should i have to mention as Id is not known to me.

What I have tried:

I have one table contain following columns

Id,imagename,countRate

there are many rows in table containing different imagesname.

those all images are shown into the front end, after clicking on button with each image increment the countRate of that image. My difficulty is that how can I know that any perticulare countRate is for respected imageName. in where clause what should i have to mention as Id is not known to me.

推荐答案

如果没有设置PK(主键)字段,这是不可能的。这将允许您唯一地标识每列。如果您不知道该行的ID,则设置2(两个)PK。



下一步是什么?

现在您可以选择来自数据控件(如gridview,datalist或repeater)的ImageName,每当收集ImageName时,您只需检查列ID的相同行,并使用它来获取countRate或直接从控件中的数据行中选择countRate。 />


希望这有助于
This is not possible without setting a PK (primary key) field. This will allow you to identify each column uniquely. If you don't know the ID for the row then set 2 (two) PKs.

WHATS NEXT?
Now you can pick the ImageName from a data control like gridview, datalist or repeater, whenever the ImageName is collected you just have to check the same row for column ID and use it to get the countRate or maybe pick countRate directly from the datarow in the control.

Hope this helps


这篇关于Mysql查询获取select perticulare列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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