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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:17:21+00:00 2026-05-27T22:17:21+00:00

I could use a little help on a MySQL database issue I am dealing

  • 0

I could use a little help on a MySQL database issue I am dealing with. I have gone through a bunch of old answers to almost the same question, – but have had no luck sofar. Some of the answers seem like it is what I need (JOIN, INNER JOIN, JOIN LEFT), – but still doesnt give me the correct output. I got either a weird output or a plain error-message…

OK here goes:

I have 4 tables – and they all contain the same number of fields – with the same name. So 4 different tables with duplicate fields.

I need to fetch everything from all 4 tables where field eid=219, into one array, .

I need to be able to limit the output to 20 rows – so I can display them on separate pages. Which means the starting point will be different depending on current page…

Any idea how to go about this?

Lets say that the tables are:

table1
table2
table3
table4

And they all contain the fields:
id
eid
name
tekst

Thx
John

  • 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-27T22:17:21+00:00Added an answer on May 27, 2026 at 10:17 pm

    You need a UNION query:

    (SELECT id, eid, name, tekst, 'from table 1' as table_source FROM table1)
    UNION
    (SELECT id, eid, name, tekst, 'from table 2' as table_source FROM table2)
    UNION
    (SELECT id, eid, name, tekst, 'from table 3' as table_source FROM table3)
    UNION
    (SELECT id, eid, name, tekst, 'from table 4' as table_source FROM table4)
    ORDER BY name LIMIT 20
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'am new to Python 3 and could really use a little help. I have
So I have a lot of projects coming that could use a little dhtml
I could use a little help in AppEngine land... Using the [Python] API I
I could use a little help with an XPath-Expression. check the code below; how
I'm having some trouble writing a jQuery function and could use a little help.
I am new to XHTML and I could use a little bit of help.
I'm writing my first rails plugin and could use a little help. In a
I'm getting started with Erlang, and could use a little help understanding the different
I could use a little help. I got this program to work right then
I could use a little help trouble shooting this problem. When using the app

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.