Search
 
SCRIPT & CODE EXAMPLE
 

SQL

How to take sum of column with same id and different table in SQL?

select t2.szCustId
     , t2.bAllowToCredit
     , sum(t1.decCreditLimit) as decCreditLimit 
from table1 t1
join table2 t2 on t1.szCustId = t2.szCustId
group by t2.szCustId
       , t2.bAllowToCredit
Comment

PREVIOUS NEXT
Code Example
Sql :: create temp table sql 
Sql :: oracle insert from select 
Sql :: limit and offset in stored procedure mssql 
Sql :: mysql get table column names and data types 
Sql :: mssql default connection string 
Sql :: SQL SUM() Function 
Sql :: SQL:RANK function to delete duplicate rows 
Sql :: update from select postgresql 
Sql :: oracle merge insert if not exists 
Sql :: how to verify sequence result in oracle SQL 
Sql :: how to dump .csv file into mysql 
Sql :: sql select where id not exists in another table 
Sql :: t sql cursor tr 
Sql :: add column first position mysql 
Sql :: Find the names of sailors who have reserved a red boat, and list in the order of age 
Sql :: select all columns except one sql 
Sql :: select only columns that are not empty oracle sql 
Sql :: open cursors in oracle 
Sql :: php select data from mysql database without column name 
Sql :: postgresql between 
Sql :: end mysql command 
Sql :: what is table in sql 
Sql :: how to print some string in mysql 
Sql :: update table sql 
Sql :: mysql current date between two dates 
Sql :: Should I use the datetime or timestamp data type in MySQL? 
Sql :: sqlite3.OperationalError: near "7": syntax error 
Sql :: what is between operator 
Sql :: mysql backup certain tables workbench 
Sql :: postgres duplicate database in same server while other session is using source database 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =