Trying to execute following query 

```
> Resort.findAndCountAll(
>         {
>             where: { status: "active", name: { [Sequelize.Op.like]: '%' + _search_like + '%' } },
>             attributes: [
>                 "id",
>                 "name",
>                 "email",
>                 "mobileNumber",
>                 "averagePrice",
>                 "description",
>                 "rating",
>                 "location",
>                 "city",
>                 "country",
>                 [Sequelize.fn('AVG', Sequelize.col('resortReview.rating')), 'total'],
>                 [models.sequelize.literal(`Concat('` + imageHelper.SERVER_IMAGE_ROOT_URL + `',image)`), 'image']],
>             include: [{
>                 model: models.resortReview,
>                 required : false,
>                 attributes: []
>             }],
>             limit: limit,
>             offset: offset,
>             group: ["resort.id"],
>             order: [
>                 [sort, order],
>             ]
>         }
>     )

```

please find the association ,

```
db.resortReview.belongsTo(db.resort, {onDelete : 'CASCADE'});
db.resort.hasMany(db.resortReview, {foreignKey : 'resortId'});

```

but am getting following error

> 
> Unhandled rejection SequelizeDatabaseError: Unknown column
>  'resortReview.rating' in 'field list' .
> 
> 
> 

Query generated :- 

```
SELECT `resort`.* 
FROM   (SELECT `resort`.`id`, 
               `resort`.`name`, 
               `resort`.`email`, 
               `resort`.`mobilenumber`, 
               `resort`.`averageprice`, 
               `resort`.`description`, 
               `resort`.`rating`, 
               `resort`.`location`, 
               `resort`.`city`, 
               `resort`.`country`, 
               Concat('http://hamsontech.com:9093/images/', image) AS `image`, 
               Avg(`resortreviews`.`rating`)                       AS `total` 
        FROM   `resorts` AS `resort` 
        WHERE  `resort`.`status` = 'active' 
               AND `resort`.`name` LIKE '%%' 
        GROUP  BY `resort`.`id` 
        ORDER  BY `resort`.`name` ASC 
        LIMIT  0, 10) AS `resort` 
       LEFT OUTER JOIN `resortreviews` AS `resortReviews` 
                    ON `resort`.`id` = `resortreviews`.`resortid` 
ORDER  BY `resort`.`name` ASC; 

```

don't know what I'm missing ?