1
Personal I have a query in SQL that returns the values not duplicated column: Nº Tel, and that has the Status equal to TEMPORARY MALFUNCTION
SELECT DISTINCT [Nº Tel] FROM [export$] WHERE [Status] = "ANOMALIA TEMPORÁRIA"
I now need to join the rest of the columns that are in the same table [export] according to the result I brought from the first SELECT
The rest of the columns are:
- [CPF/CNPJ]
- [Number Contract]
- [Reason for Sending]
- [Activation Date]
- [Date Import]
- [Date Amended]
- [Status]
And how does the first part join with the second part? Post example, so that we can understand.
– José Diz
Let me try to be more objective, well the first thing to do was to bring the non-repeated data, ok is done, but when I run this query: SELECT DISTINCT [Nº Tel] FROM [export$] WHERE [Status] = "TEMPORARY ANOMALY" It shows me only one column at [Nº Tel], I needed it to also show the rest of the columns, which are: [CPF/CNPJ] [Nº Contract] [Sending Reason] [Activation Date] [Import Date] [Change Date] [Status] ]
– Magno
Magno, what you wrote in your previous comment is what was already in the description of the problem. I continue with the question "how to join the first part with the original table?". If you can directly add sample samples to the description (how they look; how they look after SELECT; how they should look in the end) make it easy to understand what you need. // You may not have noticed, but if there are two or more lines in the original table for the same phone, how to decide which one should be added to SELECT and which should be discarded? ;)
– José Diz
@Josédiz I apologize for not having clarified things well and not having given examples, but it turned out that I will stay only with that SELECT same, but I saw that you have enough knowledge with Database, and I asked another question and in it I explain right, give examples, and still put the query I tried to perform, if you can help me, because I really need, but my knowledge with Database is not so great, here is the link of the post: https://answall.com/questions/361821/howto verify datae-get it-first-record-in-sql
– Magno