Hi,I'm wondering what does the T-SQL engine does in this case:I created two simple tables with data as an example:[u]Table FACT:[/u]ID_SYSTEM ID_ACCOUNT 0 1 0 2 0 1[u]Table DIM:[/u]ID_ACCOUNT ID_SET_SYSTEM 1 1 1 2[u]the update query is:[/u][code="sql"]update FACT set FACT.id_system=DIM.id_set_system from [UPDATE_FACT] as FACT inner join [UPDATE_DIM] DIM on FACT.id_account=DIM.id_account[/code]the FACT i get after the update is:ID_SYSTEM ID_ACCOUNT 1 1 0 2 1 1the result of the inner join that generates duplicates is :ID_SYSTEM ID_ACCOUNT ID_SET_SYSTEM 0 1 1 0 1 1 0 1 2 0 1 2the table above is generated with this query:[code="sql"]select test.*,dim.id_set_system from [UPDATE_FACT] test inner join [UPDATE_DIM] dim on test.id_account=dim.id_account[/code]Since there are different possible values for id_set_system I'm wondering how does sql-server generates this result i.e why does it affects the first two values of id_set_system and not the last two ones , the result is random ? or does it does some grouping and applies some aggregation ? ... ?Thanx for the info
↧