Keeping the Comma

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

Poston Tue, 15 Jan 2008 9:41 am

HELLO GUYS I'M with a DOUBT CRUEL, RS GOOD I HAVE a SELECT that CAUGHT a CERTAIN TYPE VALUES: SELECT VALUE FROM PRICE THEN HE BRINGS ME: 100.00 VALUE 2.30 1850.65 11.50 _ _ _ _ _ _ _ _ _ ETC..

QUESTION WHEN I DO SELECT SUM (VALUE) AA FROM PRICE HE RETURNS THE SUM WITHOUT COMMA BREAK porque ME HOW DO I KNOW WHERE TO PUT A COMMA BECAUSE VALUES GO BEYOND THE HOUSE OF MILLIONS.


PERSON REALLY NEED THIS TIP. VALEWS!!
carlos12
Location: rio

Poston Tue, 15 Jan 2008 9:54 am

Hey Carlos, beauty?

You can play a formatting in their values, so you can see where the comma and the period. For example:
Code: Select all
SQL> SELECT TO_CHAR(12500028.76,'999G999G999D99MI') "Total" FROM DUAL;

Total
---------------
12,500,028.76

SQL> SELECT TO_CHAR(SUM(CAMP),'999G999G999D99MI') "Total"
  2    FROM (SELECT 100.1 CAMP FROM dual
  3          UNION
  4          SELECT 200.2 CAMP FROM dual)
  5  /

Total
---------------
        300.30
but in this case the result is a char (TO_CHAR), if you do not want to put the to_char in seleect u can put at the time of presentation on the screen..

[] 's
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Tue, 15 Jan 2008 12:11 pm

My dear friend Christian (Tineks) once again on the fly gave certinho!


very very thanks
carlos12
Location: rio



Return to SQL

Who is online

Users browsing this forum: No registered users and 3 guests