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

  • Home
  • SEARCH
  • 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 181627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:47:49+00:00 2026-05-11T14:47:49+00:00

I am using a MS SQL db and I have 3 tables: ‘base_info’, ‘messages’,

  • 0

I am using a MS SQL db and I have 3 tables: ‘base_info’, ‘messages’, ‘config’

bases: ID    Name   NameNum ====================================  1    Home    101  2    Castle  102  3    Car     103  messages: ID    Signal    RecBy    HQ ============================ 111    120      Home     1 111    110      Castle   1 111    125      Car      1 222    120      Home     2 222    125      Castle   2 222    130      Car      2 333    100      Home     1 333    110      Car      2  config: ID  SignalRec  SignalOut  RecBy   HQ ==================================== 111     60        45       101    1 111     40        60       102    1 222     50        60       102    2 222     30        90       101    2 333     80        10       103    1 

Ok so now I have a subquery in which I select the ‘SignalRec’ and ‘SignalOut’ from the config table and match it on the messages table by ID and Date(not included above), the problem is that I need it to match where messages.RecBy = config.RecBy but config.RecBy is a string but it’s equivalent Name is in the bases table. So I almost need to do a subquery inside a subquery or some type of join and compare the returned value.
Here is what I have so far:

(SELECT TOP 1 config.SignalRec from config WHERE config.ID = messages.ID AND ||I need th other comparison here||...Order By...) As cfgSignalRec, (SELECT TOP 1 config.SignalOut from config WHERE config.ID = messages.ID AND ||I need th other comparison here||...Order By...) As cfgSignalOut 

I tried to make this as clear as possible but if you need more info let me know.

  • 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. 2026-05-11T14:47:50+00:00Added an answer on May 11, 2026 at 2:47 pm

    I think I might have not been clear enough what I wanted to do, sorry about that. The data is actually different in the 2 tables, although the correlations are the same. It’s kind of confusing to explain without going into detail about how the system works.
    I actually found a very fast way of doing this.
    Inside my sub-query I do this:

    (SELECT TOP 1 config.Signal FROM config,bases       WHERE config.ID = messages.ID AND bases.Name = messages.RecBy AND bases.NameNum =       config.RecBy Order By...)   

    So this essentially compares the 2 RecBy’s of different tables even though one is an integer and the other is a string. It reminds me of a match and look up in Excel.

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

Sidebar

Ask A Question

Stats

  • Questions 133k
  • Answers 133k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe you don't have the certificate installed on that machine.… May 12, 2026 at 6:40 am
  • Editorial Team
    Editorial Team added an answer GroupBy won't help you here anyway, because it assigns every… May 12, 2026 at 6:40 am
  • Editorial Team
    Editorial Team added an answer From some quick initial testing it does look like changing… May 12, 2026 at 6:40 am

Related Questions

I am using a MS SQL db and I have 3 tables: 'base_info', 'messages',
Say I have a website and a database of that website hosted locally on
I have a MS SQL DB with various tables, and one field in particular
I am trying to execute a stored procedured from a linked database in MS
I have a client/server application that depends on MS SQL database for backend storage,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.