Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6181931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:06:53+00:00 2026-05-24T01:06:53+00:00

im trieng to select data from 3 diffrent tables, i want to select the

  • 0

im trieng to select data from 3 diffrent tables, i want to select the data and filter it that the fullname dont apper twice and the number of order from this fullname will grouped to one. i tried these query but it gave me an error, can you help me?

SELECT 
   `biz`.`id`, 
   `deals`.`biz_id`,
   `deals`.`id` as `deal_id`,
   `deals`.`name`, 
   `orders`.`id`,
   `users`.`username`,
   `users`.`fullname`,
   `users`.`id` as `user_id`,
   `orders`.`dealid`, 
   `orders`.`userid` ,
    COUNT(`orders`.`userid`) as `num` 
FROM 
  `deals`,
  `users`,
  `orders` 
WHERE 
  `deals`.`biz_id` = '{$User['id']}' 
  AND `orders`.`dealid` = `deal_id` 
  AND `users_id` = `deals`.`userid`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:06:54+00:00Added an answer on May 24, 2026 at 1:06 am

    In your statement, the first field you are selecting is ‘id’ field from ‘biz’ table. However, ‘biz’ table is not in your FROM clause.

    I think I can guess how to fix it:

    SELECT 
       `biz`.`id`, 
       `deals`.`biz_id`,
       `deals`.`id` as `deal_id`,
       `deals`.`name`, 
       `orders`.`id`,
       `users`.`username`,
       `users`.`fullname`,
       `users`.`id` as `user_id`,
       `orders`.`dealid`, 
       `orders`.`userid` ,
        COUNT(`orders`.`userid`) as `num` 
    FROM 
      `biz`,
      `deals`,
      `users`,
      `orders` 
    WHERE 
      `deals`.`biz_id` = '{$User['id']}' 
      AND `biz`.`id` = `deals`.`biz_id`
      AND `orders`.`dealid` = `deal_id` 
      AND `users_id` = `deals`.`userid`
    GROUP BY `orders`.`userid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am tring to get a list of dates from my db that will
I have a tsql snippet similar to this: select p.Make, count(p.Make) as _count from
I want to convert my sql data to csv files while clicking on a
Hi I am tring to import data from excel to sql 2005 .working fine
I am tring update a record and want to exclude one column from the
I am tring to map json data using Gson from a URL to my
I am tring to load razor views from a physical path that is outside
Im tring to pull data once from Mysql into c. Then create an NUMPY
im my app that im tring to build, i want to have a table
I am tring to query a set of data from mySQL with the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.