1

I've to fetch record from two table by using JOIN.The record should come order by Date first and in that date record should be sorted by review column (both in desc order).

All work is done by raw queries and no relation or modals are defined (very outdated code). So what is the possible solution?

Screenshot

select `Feedback`.`FeedbackId`, `Feedback`.`SiteId`, `Feedback`.`MyTestimonial`, `Feedback`.`ReviewDate`,`Feedback`.`Overall` as `F_Overall`, `Feedback`.`Code`, `ProductFeedback`.`PID` as `ProductId`,`ProductFeedback`.`Product` as `ProductName`, `ProductFeedback`.`Rating`, `ProductFeedback`.`FeedbackId` as `ProductFeedbackId`, `ProductFeedback`.`Id` as `PF_Id`,   from `Products` as `Products`  inner join `ProductFeedback` as `ProductFeedback` on `Products`.`Id` = `ProductFeedback`.`PID` inner join `Feedback` as `Feedback` on `Feedback`.`FeedbackId` = `ProductFeedback`.`FeedbackId` where `ProductFeedback`.`Rating` > 0 order by `ReviewDate` desc, `ProductFeedback`.`Rating` desc limit 21 offset 0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.