date counter

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Wed, 05 Dec 2007 2:19 pm

Hello guys and CHEEZBURGER NETWORK, my question of the day is how after I select Add up the amount of data returned in DTEXCLUSAO table, like Let's say my table bring 10 record contained in this table then I wanted to add up because in fact a are ten record are more than 500 imagine adding all (TO_CHAR (u. dtinicio, ' dd/mm/yyyy ') || ' | ' || FLOOR (TRUNC (sysdate)-TRUNC (u. dtinicio)) || ' days | '
|| TO_CHAR (sysdate, ' dd/mm/yyyy ')) days, u. dtexclusao, exclusion valews
carlos12
Location: rio

Poston Wed, 05 Dec 2007 2:41 pm

Hey Carlos, beleza?

man I couldn't understand right, you wanted to add the amount of records that have the DTEXCLUSAO field filled out and inform him directly below your select?

[] 's
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Wed, 05 Dec 2007 2:54 pm

so I wanted to add only those that he brings there type has null and the records like this: dtexclusao 12/31/2006 10/11/2007 null null 8/1/2007 I want to sum only the amount of data returned and not the null spaces, upstairs for example has 3: wink:
carlos12
Location: rio

Poston Wed, 05 Dec 2007 3:04 pm

Carlos, would that be??

Code: Select all
SELECT COUNT (1)
  FROM tabela
WHERE dtexclusao IS NOT NULL


[]'s
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Wed, 05 Dec 2007 3:25 pm

my friend Christian (Tineks) That I think I'm going to have to leave because I see that I'm going to have to do a select into another because that dataexclusão has a whole context behind, Guy has a select bringing multiple columns and etc, so for me to add a counter only the column, dtexclusão have to do a select within this select and doing a relationship with outside hahahahah very complicated, lol but even the force valeu select is more or less like this: SELECT ' 1 ' seq, u. field1 contract, p. field2, field3 u.s. name first, (TO_CHAR (u. dtinicio, ' dd/mm/yyyy ') || ' | ' || FLOOR (TRUNC (sysdate)-TRUNC (u. dtinicio)) || ' days | '
|| TO_CHAR (sysdate, ' dd/mm/yyyy ')) days, u. dtexclusao, v. campo4, exclusion FROM U table, table, table table v, P m, (SELECT COUNT (1) FROM table WHERE dtexclusao IS NOT NULL) aaa WHERE p. field1 (+) = u. campo2_USUARIO and u. field3 = m. campo4 (+) and u. campo5 (+) = v. campo6 and p. campo7 = ' F ' AND u. campo8 < '% 9 ' AND u. campo9 > = ' & START ' order by asc 4 SAW HOW MAD!!
carlos12
Location: rio

Poston Wed, 05 Dec 2007 4:00 pm

How u have q display the total line will not be good, gotta have a subselect.

[]s!!
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP



Return to SQL

Who is online

Users browsing this forum: No registered users and 2 guests