sqlhelp Posted November 7, 2014 Report Posted November 7, 2014 ee select query ni update statement ki convert cheyali select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid something like with the select condition ? --update Db..Person set p.Paid = MAX(s.EndDate) select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid
DaleSteyn1 Posted November 7, 2014 Report Posted November 7, 2014 simple thing google chesi chesukovachu anni memu chebthe nuvvendhi nerchukunedhi
papacha Posted November 7, 2014 Report Posted November 7, 2014 UPDATETableSETTable.col1 = other_table.col1,Table.col2 = other_table.col2FROMTableINNER JOINother_tableONTable.id = other_table.id Try this
sqlhelp Posted November 7, 2014 Author Report Posted November 7, 2014 simple thing google chesi chesukovachu anni memu chebthe nuvvendhi nerchukunedhi already try chesanu in different ways but i keep getting error "the multi part identifier could not be bound "
SUbba LIngam Posted November 7, 2014 Report Posted November 7, 2014 idedo anukuntunna,,,,,,, update Db..Person set (db.ID,db.EndDate) = ( select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid ) where exists (select 'x' from from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid )
DaleSteyn1 Posted November 7, 2014 Report Posted November 7, 2014 already try chesanu in different ways but i keep getting error "the multi part identifier could not be bound " a error ardham anna telusa neeku ? ekkado field ni wrong alias tho call chesthunav adhi choodu mundhu
zerokool1290 Posted November 7, 2014 Report Posted November 7, 2014 a error ardham anna telusa neeku ? ekkado field ni wrong alias tho call chesthunav adhi choodu mundhu Dale steyn baa... kaastha cool avvu.
sqlhelp Posted November 7, 2014 Author Report Posted November 7, 2014 a error ardham anna telusa neeku ? ekkado field ni wrong alias tho call chesthunav adhi choodu mundhu antha satirical reply enduku ? naku antha knowledge unte ikada enduku question vesthanu I am still learning.
sqlhelp Posted November 7, 2014 Author Report Posted November 7, 2014 UPDATETableSETTable.col1 = other_table.col1,Table.col2 = other_table.col2FROMTableINNER JOINother_tableONTable.id = other_table.id Try this I did try like this group by condition midha error avthundi and order by add chesina same error
Johny Posted November 7, 2014 Report Posted November 7, 2014 lite theesukoni delete all kotti weekend cheers cheppu!
ceelogreen Posted November 7, 2014 Report Posted November 7, 2014 ee select query ni update statement ki convert cheyali select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid something like with the select condition ? --update Db..Person set p.Paid = MAX(s.EndDate) select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid Yesuko updatuuuu update up Set Paid = FeePaid from db..Person up inner join ( select distinct(s.ID),MAX(s.EndDate) as FeePaid,p.Paid from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid ) dp on up.ID = Dp.ID
loveindia Posted November 8, 2014 Report Posted November 8, 2014 UPDATE p SET p.paid = MAX(s.EndDate) from Db..Person p inner join Db..vwstudent s on p.ID = s.ID where s.Product= 1 group by s.ID,p.Paid having MAX(s.EndDate) <> p.Paid Multi-part identifier error antey, if you have specified an alias in your query and you are using different alias somewhere else SQL is not able to find that identifier and so doesn't know what to do and throws an error to you... simple..
Recommended Posts