mistektips
Programmer
Hi,
There are 2 tables:
Table A (SecurityID, SecurityName)
Table B (SecurityID, Price, ClDate)
The query is to find the average price with Name=ABC Corp in year 2005
I wanted to know if this query would be right. If not, then why?
select avg(price) from B, A group by securityID having A.SecurityID=B.SecurityID and SecurityName='ABC Corp' and year(ClDate)=2005
There are 2 tables:
Table A (SecurityID, SecurityName)
Table B (SecurityID, Price, ClDate)
The query is to find the average price with Name=ABC Corp in year 2005
I wanted to know if this query would be right. If not, then why?
select avg(price) from B, A group by securityID having A.SecurityID=B.SecurityID and SecurityName='ABC Corp' and year(ClDate)=2005