帮助 ado.net 中的选择查询
我有一个表(newsImages),其中包含列 newsID(外键) , newsImage , imageID(主键),我的查询是什么 从 newsImages 中选择 newsImage 其中 newsID = 'something'
查询返回所有具有特定 newsID 的图像,我想要的是从结果查询中删除图像名为“something”的行。任何帮助或建议将不胜感激
I have got a table(newsImages) with columns newsID(Foreign Key) , newsImage , imageID(primary Key), What my query is Select newsImage From newsImages Where newsID = 'something'
The query returns all the images with specific newsID, What I want is to remove a row who has image named"something" from the resultant query. Any help or suggestion will be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您会这样做
,但要小心,您的 ID 字段看起来好像是文本字段。
你确定ID字段保证是唯一的吗?它是否被定义为主键?如果不是,您可能有多个具有相同 ID 的行,并且您可能会删除比预期更多的行。
编辑
啊,好的
You would do
But be careful, it looks as though your ID field is a text field.
Are you sure that the ID field is guaranteed to be unique? Is it defined as a Primary Key? If not you may have several rows with the same ID and you may delete more than you were expecting to.
EDIT
Ah, ok
选择除 ID 为“something”的 newsImage 之外的所有内容,
从表 newsImages 中删除 ID 为“something”的 newsImage
To select everything but the newsImage with id 'something'
to delete newsImage with ID 'something' from the table newsImages