I have these 2 tables
table 1
----------------------------------
| articulo | Ubicacion |
----------------------------------
| 200116 | cy1112 |
----------------------------------
| 200116 | ee3091 |
----------------------------------
table 2
----------------------------------
| articulo | Ubicacion |
----------------------------------
| 200116 | cy1112 |
----------------------------------
| 200116 | dd3091 |
----------------------------------
I'm trying to do it this way
SI_Ubicacion = COUNT(DISTINCT ISNULL(tabla1.SI_Ubicacion,tabla2.SI_Ubicacion))
is that you tell me the locations and if they are the same, do not count it twice and the result must be SI_Ubicacion = 3
At this moment you are only telling me the locations of the first table
The tables are related by articulo
I hope you can help me, Thanks.