I am trying to do following.

Select a Hospital with id = hid from table named as hospital. 
Add a value "overall\_rating" to it and get all the ratings and make avg of it from another table named as hrating

here is my query

```
 $statement = $conn->prepare('SELECT hospital.*,(SELECT AVG(hrating.rating_h) FROM hrating WHERE hid = hospital.hid) as overall_rating WHERE hid=:hid LIMIT 1');

```

Getting this error

```
{"error":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE hid='44' LIMIT 1' at line 1"}

```

Where am i being wrong.