我如何从中选择数据

编程入门 行业动态 更新时间:2024-10-28 08:30:06
本文介绍了我如何从中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有三个桌子 Tbl_Auction A_id, Pro_id, 状态(``L'',``F'',``C'') Tbl_BidPlace BP_id, Pro_id, L_id

i have three table Tbl_Auction A_id, Pro_id, Status (''L'',''F'',''C'') Tbl_BidPlace BP_id, Pro_id, L_id

if data in Tbl_Auction -------- 1 1 L 2 2 F 3 3 C 4 4 L 5 5 L 6 6 L

data in Tbl_BidPlace ---------------------- 1 4 1 2 2 1 3 4 2 4 4 1 5 3 2 6 2 2 7 4 1 8 1 1 9 1 2 10 5 1 11 6 1 12 2 1

现在我想要盖子1的数据 数据应为 孔盖的孔产品标价计数

now i want data for for Lid 1 data should be count number of bid placed on perticular product for perticular Lid

Pro_id, PlacedBid 1 1 4 3 5 1 6 1

我无法解决此SQL查询 请帮忙.... 谢谢您.

i can not solve this SQL query please help.... thank you

推荐答案

select a.Pro_Id,count(BP.Bidplace_id) from TBl_Auction a,Tbl_BidPlace BP where IsAuction='L' and a.Pro_Id=BP.Pro_id and BP.L_id=4 group by a.Pro_Id

选择一个Pro_Id,count(BP.Bidplace_id) 来自TBl_Auction的内部联接Tbl_BidPlace BP on a.Pro_Id = BP.Pro_id 其中IsAuction =''L''和 BP.L_id = 4 按a.Pro_Id分组 祝你好运 Hey, select a.Pro_Id,count(BP.Bidplace_id) from TBl_Auction a inner join Tbl_BidPlace BP on a.Pro_Id=BP.Pro_id where IsAuction=''L'' and BP.L_id=4 group by a.Pro_Id Best luck

更多推荐

我如何从中选择数据

本文发布于:2023-10-19 11:23:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1507349.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!