Group by Query help from multiple tables |
Hello,
I need help in a query from multiple tables. Here are the table names:- products images (for product's images) users
Here is the query I have been trying:- Code: public function random_three_sellers(){ 3. Is it possible to add total number of followers per user. This data is in another table named "followers" , the column is "following_id" 4. Finally, how to show them in the view's loop? Please ask me if any more info is required for the solution. Regards.
@jTam,
if you give me the table definitions (and test data for each of the 4 tables-products, images,users and followers) then I can use http://sqlfiddle.com/ to help you figure it out.
Hello php_rocs,
Thank you for reply. The tables are connected by these columns: products (id) -> images (product_id) products (user_id) -> users (id) users (id) -> followers (following_id) Edit: uploaded test data "sql" file .. I can not see the uploaded file. So sharing link from googledrive. https://drive.google.com/open?id=1tuctBn...pdViMWcLPm |
Welcome Guest, Not a member yet? Register Sign In |