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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:00:26+00:00 2026-06-15T00:00:26+00:00

In postgresql I can use subquery in join condition SELECT * FROM table1 LEFT

  • 0

In postgresql I can use subquery in join condition

SELECT * 
FROM table1 LEFT JOIN table2
     ON table1.id1 = (SELECT id2 FROM table2 LIMIT 1);

But when I try to use it in Access

SELECT *
FROM table1 LEFT JOIN table2 
     ON table1.id1 = (SELECT TOP 1 id2 FROM table2);

I get syntax error. Is it actually impossible in Access or just my mistake?

I know that I can get the same result with WHERE, but my question is about possibilities of JOIN in Access.

  • 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-15T00:00:27+00:00Added an answer on June 15, 2026 at 12:00 am

    It’s not possible, per the MSDN documentation:

    Syntax

    FROM table1 [ LEFT | RIGHT ] JOIN table2 ON table1.field1 compopr table2.field2

    And (emphasis mine):

    field1, field2: The names of the fields that are joined. The fields must be of the same data type and contain the same kind of data, but they do not need to have the same name.

    It appears you can’t even have hard-coded values in your join; you must specify the column name to join against.

    In your case, you would want:

    SELECT *
    FROM Table1
    LEFT JOIN (
        SELECT DISTINCT TOP 1 ID 
        FROM Table2
        ORDER BY ID
    ) Table2Derived ON Table1.ID = Table2Derived.ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can we use the cascade in PostgreSQL while deleting the one record from
Since I'm using Postgresql and can't use LINQ to SQL, I wrote my own
Can I use MongoDB and a PostgreSQL in one rails app? Specifically I will
How can I make a range in a select in PostgreSQL? I'd like to
I'm trying to setup python fabric for postgresql, but can't figure out how to
How can I do such query in Postgres? IF (select count(*) from orders) >
This question has been asked before - How we can use CTE in subquery
The documentation for PostgreSQL window functions seems to imply you can use the same
Why can't one use an output column in the having clause in postgresql? It
Is there a Rails way to manually populate databases? I can use PostgreSQL with

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.