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 7636843

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:47:14+00:00 2026-05-31T07:47:14+00:00

Basically I have a small ‘invoicing’ type system where I have a MySQL table

  • 0

Basically I have a small ‘invoicing’ type system where I have a MySQL table set up for the individual invoices, the invoice lines, and items associated with each invoice, sort of like this:

table invoices:

fields: invoice_id | type | fees | comments | company

—

table invoice_lines:

fields: id | invoice_id | name | description | quantity

—

table invoice_affected_items

fields: id | invoice_id | item_id

I can have many invoice lines and many affected items to one invoice id. In this case would a join be best or should I just join the invoice lines to the table and retrieve the affected items using a separate query?

Thanks.

  • 0 0 Answers
  • 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-31T07:47:15+00:00Added an answer on May 31, 2026 at 7:47 am

    You could join, but that would result in pulling a lot of extra data. If you join the lines on to the invoices for example, you’d be pulling the invoice multiple times – once for each line…

    So to answer your question. I’d do it in separate queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have a small template that looks like: <xsl:template name=templt> <xsl:param name=filter />
I have a small project that basically a Python wrapper to a websites API.
I have a small python script which i use everyday......it basically reads a file
I'm developing a small application using Blend, basically what I have in my application
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I basically have a server set up and I'm accepting new clients(UNIX) and i'm
I have a small quiz web application to deploy. Basically I have 2 pages,
I have limited SQL background, basically a small amount of manipulation through HTML and
I have some small sets of data from the database (mysql) who are seldom
I have a small PHP framework that basically just loads a controller and a

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.