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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:04:46+00:00 2026-05-18T20:04:46+00:00

I have 2 tables, Table1: id, int1, int2, int3 john,1,2,4 tim,2,3,4 pete,1,3,4 Table2: integer,blob

  • 0

I have 2 tables,

Table1: 
id, int1, int2, int3
john,1,2,4
tim,2,3,4
pete,1,3,4

Table2:
integer,blob
1,wins
2,backtickle
3,text
4,whatever

The query I want to use is given the id I want to get the blob data from table2 associated with each of the integer columns in table1.

What is the specific query I can use here?

Sample result I am looking for would be something like:

search John returns “wins”,”backtickle”,”whatever”

search pete returns “wins”,”text”,”whatever”

I think it has something to do with foreign keys, but not sure…beginner level please! With 1 table it would be SELECT * FROM table1 WHERE id=”……..” but not sure with the setup i have now given above.

  • 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-18T20:04:47+00:00Added an answer on May 18, 2026 at 8:04 pm

    The structure of your database does not look optimal. You’re limiting yourself to 3 items per person, and you’re using columns instead of rows in order to list them. What you actually have in your data is a many-to-many relationship between Table1 and Table2. What I’d recommend is using three tables:

    Persons: 
    name, personid
    john,1
    tim,2
    pete,3
    
    PersonBlobs:
    personid, blobid
    1,1
    1,2
    1,4
    2,2
    2,3
    2,4
    3,1
    3,3
    3,4
    
    Blobs:
    blobid,blob
    1,wins
    2,backtickle
    3,text
    4,whatever
    

    PersonBlobs would give you the many-to-many link between Persons and Blobs.

    And then the query becomes:

    select Blobs.blob
    from Blobs inner join PersonBlobs on Blobs.blobid = PersonBlobs.blobid
               inner join Persons on PersonBlobs.personid = Persons.personid
    where Persons.name = 'John'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database with two tables ( Table1 and Table2 ). They both
I have 2 tables. Table1 has fields A, B, C, D and Table2 has
i have 2 tables table1: num,X,Y table2: num,X,Y i need to update X and
actually i have 2 tables table1 and table2 table1 name city addr. table2 name
I have two tables, table1 ( Id, date, info1) table2 ( Id, date, nvarchar(50)
I have two tables in my database, table1 and table2. They are identical. But
I have 3 tables t1,t2,t3 each having 35K records. select t1.col1,t2.col2,t3.col3 from table1 t1,table2
I have two tables with the following columns: table1: id, agent_name, ticket_id, category, date_logged
I have a query that looks like this: select id , int1 , int2
I have two tables: Table 1: ID, PersonCode, Name, Table 2: ID, Table1ID, Location,

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.