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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:13:19+00:00 2026-05-31T16:13:19+00:00

1I have the following two tables (sample data) and need to be able to

  • 0

1I have the following two tables (sample data) and need to be able to group the all the id‘s which belong to the larger group called code and dateCreated, group when the dates are the same for the code

table1:

dateCreated | id
2011-12-27  | 1
2011-12-15  | 2
2011-12-17  | 6
2011-12-26  | 15
2011-12-15  | 18
2011-12-07  | 22
2011-12-09  | 23
2011-12-27  | 24

table2:

  code      | id
    EFG     | 1
    ABC     | 2
    BCD     | 6
    BCD     | 15
    ABC     | 18
    BCD     | 22
    EFG     | 23
    EFG     | 24

So the results (Hopefully right) should I need would be where codes are grouped by date:

dateCreated | code
2011-12-27  | EFG
2011-12-15  | ABC
2011-12-17  | BCD
2011-12-26  | BCD
2011-12-07  | BCD
2011-12-09  | EFG

Hopefully this makes sense….

I’ve tried a few things most recent something like this but without any luck (invalid column GroupCodes)

select dateCreated, (SELECT  distinct  code
                     FROM  table2 INNER JOIN
                     table1 ON id = table2.id) as GroupCodes

from table1
group by dateCreated, GroupCodes
  • 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-31T16:13:20+00:00Added an answer on May 31, 2026 at 4:13 pm

    Maybe I’m missing the issue, but wouldn’t the following work?

    SELECT DISTINCT
        t1.dateCreated, t2.code
    FROM
        table1 t1 JOIN
        table2 t2 ON t1.id = t2.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables invoices and pending_payments both of which have the following rows
I have the following code that will join two different tables together and provide
I have two tables in SQL and I need to be able to do
I have the following two tables, affiliates and referrers. affiliates Table id loginid 3
I have the following two tables: Customer { int Id int Name } Bills
I have the following two tables: Table1 ---------- ID Name 1 A 2 B
Say for example, I have the following two tables: TableA { _id } TableB
I am using VB.NET with LINQ to MS SQL. I have two following tables.
I have two tables: Contact (id,name) Link (id, contact_id, source_id) I have the following
I have the following query where I combine two fields from two tables: <cfquery

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.