Click here to Skip to main content
15,923,164 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more: , +
i have three table

Tbl_Auction
A_id,
Pro_id,
Status ('L','F','C')

Tbl_BidPlace
BP_id,
Pro_id,
L_id

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


HTML
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



now i want data for for Lid 1
data should be

count number of bid placed on perticular product for perticular Lid

HTML
Pro_id,  PlacedBid
    1          1
    4          3
    5          1
    6          1

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

thank you
Posted
Updated 21-Feb-12 4:36am
v2
Comments
PKriyshnA 21-Feb-12 10:41am    
i use for L_id===4

SELECT a.Pro_id,count(BP.Bidplace_id)
FROM TBl_Auction a,Tbl_BidPlace BP
where a.IsAuction='L'
and a.Pro_Id=BP.Pro_id
and BP.L_id=4;

did not get data....please help

SQL
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
 
Share this answer
 
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900