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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:32:36+00:00 2026-06-16T18:32:36+00:00

I have two tables. Transaction ———— TransactionId Date Amount Quantity ProductCode etc -and- Product

  • 0

I have two tables.

Transaction
------------
TransactionId
Date
Amount
Quantity
ProductCode
etc

-and-

Product
-----------
ProductId
Description
ProductCode
etc

I am trying to create a stored procedure that will give me the transactions with the description of the product with them.

I have this so far but it’s not even close to compiling. I’m not understanding SQL syntax to well.

USE SuburbanPortal;
SELECT [CompanyCode]
      ,[Status]
      ,[Branch]
      ,[ProductCode]
      ,[TransactionBranch]
      ,[AccountNumber]
      ,[ReferenceNumber]
      ,[TransactionDate]
      ,[Quantity]
      ,[Amount]
      ,[SalesTax]
  FROM [Company].[Transaction]
  LEFT OUTER JOIN [Company].[Transaction] ON
    [Company].[Transaction].[ProductCode] = [Company].[Products].[ProductCode]

Can someone point me in the right direction?

  • 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-16T18:32:37+00:00Added an answer on June 16, 2026 at 6:32 pm

    Why aren’t you using an INNER JOIN? Also, you’re joining [Transaction] on [Transaction] instead of [Transaction] on [Product].

    SELECT  T.ProductCode
            ,T.[Field1]
            ,T.[Field2]
            ,P.[Field1]
            ,P.[Field2]
    FROM    [Company].[Transaction] T
            INNER JOIN [Company].[Product] P
                ON T.[ProductCode] = P.[ProductCode];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables from which I'm trying to run a query to return
I have two tables: categories => Category_ID , Title , Description , Default_Points ,
I have two tables. One table is meant to serve as a transaction history
I've got two tables The first has user transactions: Date Transaction P1 P2 P3
I have two database tables, subscription and transaction , where one subscription can have
I have two tables user (one) and transaction (many) and I need to get
I have two tables USER and TRANSACTION i want to choose the data from
I have two tables, one with transactions (with date). The other with a percentage
I have a table Tran with transaction records. I have two tables, Parameters1 and
I have two tables which have some transactional stuff stored in them. There will

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.