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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:49:24+00:00 2026-05-14T03:49:24+00:00

i have a table with the columns such id, tid, companyid, ttype etc.. the

  • 0

i have a table with the columns such id, tid, companyid, ttype etc..

the id may be same for many companyid but unique within the companyid and
tid is always unique and

i want to calculate the total no of transactions entered in the table,

a single transaction may be inserted in more than one row,

for example,

id tid companyid ttype 
1  1   1         xxx
1  2   1         may be null
2  3   1         yyy
2  4   1         may be null
2  5   1         may be null

the above entries should be counted as only 2 transactions ..

it may be repeated for many companyids..

so how do i calculate the total no of transactions entered in the table

i tried

select sum(count(*)) from transaction group by id,companyId; 

but doesn’t work

select count(*) from transaction group by id; 

wont work because the id may be repeated for different companyids.

  • 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-14T03:49:25+00:00Added an answer on May 14, 2026 at 3:49 am

    You may need to rephrase your requirement. But from my understanding, following could work:

    
    select count( distinct id, companyid ) from transaction ;
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that in a case where a table has many columns, but
Lets say I have a table with columns such as: ID Name City State
When dealing with a denormalised (legacy) database table, whereby you have columns such as:
I have a database table with many columns. Is there sql that will update
I have a Product database table with columns such as product_id , price ,
First, I have 4 table and columns such as feeds (id, type, type_id) feeds_normals
I have a table where i have columns such as: deposit_received paperwork_received preferred_physician preferred_physician_phone
Suppose I have a table Books with columns Book_ID (Primary Key), ISBN (Unique), and
For example I have table that has such columns as geography and children .
The table columns have the data type BLOB and CLOB. What are the corresponding

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.