Posts by Davy Machado • 136 points
7 posts
-
1
votes1
answer32
viewsA: Doubt in SQL Table
Gustavo, as comments, it is not advisable to reuse code in a column with auto-increment. However, if you come across a situation where you need to restart or set a new increment value, use the…
-
0
votes1
answer100
viewsA: Use conditional to check dates if not in a search column with null value
Josefosad, although the question is confused, following exactly what you reported, one option is this: SELECT R.RAIN_INDEX, CASE WHEN R.READING_DATE = I.CLOSE_CYCLE OR R.READING_DATE NOT IN (SELECT…
-
1
votes2
answers62
viewsA: last table record change using MAX function
Alan, I believe the query you want is something like this: SELECT DISTINCT U.USS_CODIGO, T.CON_CODIGO, T.CON_SEQUENCIA, T.PLA_NUMERO, T.PPC_DT_ALT, T.PDT_CODIGO, T.PPC_DT_VIGENCIA,…
oracle11ganswered Davy Machado 136 -
2
votes1
answer297
viewsA: Select by group
Rone, an option is this: SELECT A.* FROM COMPRAS A WHERE (SELECT COUNT(*) FROM COMPRAS B WHERE B.NOME = A.NOME AND B.DATA >= A.DATA) <= 3 ORDER BY NOME, DATA;…
-
3
votes1
answer1901
viewsA: Backup oracle tables 11g
I believe that a logical backup (dump), generated through the EXPDP utility, is the simplest option. The directory used as the dump destination must exist in the operating system’s file system and…
-
1
votes2
answers717
viewsA: Search and people who have the same name, surname and date of birth
Whereas the ID is unique for each record, group by these fields using GROUP BY and Filtre the records with more than one occurrence using HAVING. SELECT NOME, SOBRENOME, DATA_NASCIMENTO FROM PESSOAS…
-
1
votes2
answers282
viewsA: Regular Expressions in Oracle
For cases where there is more than one space, one option is this: SELECT * FROM CIDADES WHERE REGEXP_COUNT(CIDADE, '[[:alpha:]]\s{1,}[[:alpha:]]') = 1;