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 8405797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:55:27+00:00 2026-06-09T22:55:27+00:00

i am bit confuse in to getting the result into the two tables, i

  • 0

i am bit confuse in to getting the result into the two tables, i know it is simple but not getting any clue..
here is my query the gives me the result, but when i am using the group by then it’s just giving me the result of one line even the actual result in database is (300, 500) because i am fetching the result through the lead_id which is common in both tables..

SELECT inv.amount, crmd.computers, crmd.product_id, crmd.pc_opti
FROM invoice AS inv, lead_crm_data AS crmd
WHERE inv.lead_id = '310'
AND crmd.lead_id = '310'
GROUP BY inv.lead_id

here is the result of the given query..

amount  computers   product_id  pc_opti
300     2           7, 6            2
300     3           7, 6            3
540     2           7, 6            2
540     3           7, 6            3

result with GROUP BY

300     2           7, 6            2

Desired REsult

300     2           7, 6            2
540     3           7, 6            3
  • 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-06-09T22:55:29+00:00Added an answer on June 9, 2026 at 10:55 pm

    Try this:

    SELECT inv.amount, crmd.computers, crmd.product_id, crmd.pc_opti
    FROM invoice AS inv, lead_crm_data AS crmd
    WHERE inv.lead_id = '310'
      AND crmd.lead_id = '310'
    GROUP BY inv.amount
    

    You could use a better (IMHO) syntax:

    SELECT inv.amount, crmd.computers, crmd.product_id, crmd.pc_opti
    FROM invoice AS inv INNER JOIN lead_crm_data AS crmd 
        ON inv.lead_id = crmd.lead_id 
       AND inv.lead_id = '310'
    GROUP BY inv.amount
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Bit confused here, I have an on-demand instance but do I get charged even
I'm getting a bit confuse with the rails console. I'm trying to connect to
This might be a very basic question, but I'm getting a bit confused. I'm
This should be obvious, but I'm getting a bit confused about PHP variable scope.
I'm a bit confused. Is there any simple way to set proper audio devices
I was running some code & I wasn't getting any errors, but the row
I'm just now getting into instantiating JavaScript object literals using a prototype constructor, but
I am getting a bit confused here. In our application we are having a
I am getting quite a bit confused, to me I think the following two
I am getting a bit confused. I am creating an app with storyboard, and

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.