Jump to content

Sql Doubt


Recommended Posts

Posted

i have one table with 2 rows empid and salary.

empid                salary

--------                --------

1                         1000

1                          3000

2                         8000

3                        4000

4                       7000

 

now i want to get output like

empid                     salary

---------                    --------

1                           4000            (1000+3000)

2                           8000

3                           4000

4                          7000

 

can i use inner joins concept?if not which concept i can use?

Posted

select empid, sum(salary) from <table_name> group by empid;

venkatesh+yeah+yeah+gif.gif

Posted

i have one table with 2 rows empid and salary.

empid                salary

--------                --------

1                         1000

1                          3000

2                         8000

3                        4000

4                       7000

 

now i want to get output like

empid                     salary

---------                    --------

1                           4000            (1000+3000)

2                           8000

3                           4000

4                          7000

 

can i use inner joins concept?if not which concept i can use?

 

 

Deeniki inner join enduku ra ayya... Asalu Join eppudu  use chestaro telusaa??

 

Simple ga

select Empid,Sum(salary) from table group by empid;

 

tho poye daniki join enduku Raja??

Posted

select empid, sum(salary) from <table_name> group by empid;

+1....:)

Posted

i have one table with 2 rows empid and salary.

empid                salary

--------                --------

1                         1000

1                          3000

2                         8000

3                        4000

4                       7000

 

now i want to get output like

empid                     salary

---------                    --------

1                           4000            (1000+3000)

2                           8000

3                           4000

4                          7000

 

can i use inner joins concept?if not which concept i can use?

 

Idi sql basic bhayya. Simple ga aggregation cheyi pyna cheppi nattu ....

Posted

Nak okati ardam kaleduu....

 

 

Akkada EMP ID anedii primary key aiteyy duplicate values ela vachayii...///

Posted

i have one table with 2 rows empid and salary.

empid                salary

--------                --------

1                         1000

1                          3000

2                         8000

3                        4000

4                       7000

 

now i want to get output like

empid                     salary

---------                    --------

1                           4000            (1000+3000)

2                           8000

3                           4000

4                          7000

 

can i use inner joins concept?if not which concept i can use?

first thing row ki column ki difference telsko.Sum function with groupby vaadu result ochesthadhi

Posted

Nak okati ardam kaleduu....

 

 

Akkada EMP ID anedii primary key aiteyy duplicate values ela vachayii...///

ayina primary key ekkada mention cheyaledu kada man...

Posted

Nak okati ardam kaleduu....

 

 

Akkada EMP ID anedii primary key aiteyy duplicate values ela vachayii...//

id ante default ga pk ani assume chesukunattunav

Posted

Nak okati ardam kaleduu....

 

 

Akkada EMP ID anedii primary key aiteyy duplicate values ela vachayii...///

 

 

sp_help yourtablename  execute chesi result pampu .. primary key define iyyindo ledo telustundi ..

Posted

ayina primary key ekkada mention cheyaledu kada man...

 

Mention cheyaleduu dude... but logical ga chusteyy EMPLOYEE_ID is primary key, i dont think same EMP_ID is assigned to multiple employees

×
×
  • Create New...