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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:30:15+00:00 2026-05-18T10:30:15+00:00

I ran the following simple query that looks like the example below: (Briefly; one

  • 0

I ran the following simple query that looks like the example below:
(Briefly; one order has from 1 to N items and the foreign key is order_id in table items)

SELECT orders.*, items.*
FROM orders
LEFT JOIN
items ON orders.id= items.order_id

This shows something like:

order.id    item.id
   1           34
   1           22
   1           90
   2           44
   2           19
   2           21
   2           22

I want an output like:

order.id    item.id
   1           34
               22
               90
   2           44
               19
               21
               22

How to achieve that on Access 2007 ?

Thank you in advance,
Miloud B.

  • 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-18T10:30:15+00:00Added an answer on May 18, 2026 at 10:30 am

    The only way I can think of doing this would be a self join with an aggregate. It will be easier/better handled in your application.

    SELECT
             IIF( i2.id = MIN(i.id), i.order_id, NULL) AS order_id,
             i2.id AS item_id
    FROM     items i
             INNER JOIN orders o
             ON       o.id= i.order_id
             LEFT JOIN items i2
             ON       i2.order_id=i.order_id
    GROUP BY i.order_id
    ORDER BY i.order_id,
             i2.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simple query ran when the user presses logout from my website
I have a very simple query (three where conditions; two equals, one between) from
I want to ran the following script on text files that are being committed:
I ran across the following code in Ely Greenfield's SuperImage from his Book component
Ok, so I just ran into the following problem that raised an eyebrow. For
I just ran across the following error: (.gnu.linkonce.[stuff]): undefined reference to [method] [object file]:(.gnu.linkonce.[stuff]):
Trying to make a MySQL-based application support MS SQL, I ran into the following
I've ran into a problem while trying to test following IRepository based on NHibernate:
I recently ran across some 3rd party C# code which does the following: public
there's a simple form in Lift framework and a Class with render method that

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.