Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    464

    Unanswered: thousandth operator in SQL......9i

    Hi guys

    I've asked this previously but can't find the thread anymore

    Basically, does anyone know how to insert the thousandth operator using SQL?

    Regards
    Shajju
    Last edited by shajju; 10-12-10 at 03:14.

  2. #2
    Join Date
    Mar 2007
    Posts
    623
    Quote Originally Posted by shajju View Post
    Basically, does anyone know how to insert the thousandth operator using SQL?
    What do you mean with "thousandth operator"? If it is thousandth expression in IN condition list, then it is fine - IN condition accepts at most thousand expressions. If you still intend to put there more expressions, you might use multiple IN conditions, e.g.
    Code:
    WHERE <column> IN (1, 2, ..., 1000)
       OR <column> IN (1001, 1002, ...)
       OR ...
    But, I would not expect good performance from this kind of query.
    It would be much better to create a table and INSERT all expression values there, and then simply use
    Code:
    WHERE <column> IN (SELECT <new_column> FROM <new_table>)

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What is "thousandth operator"? How does it look like? What does it do?

    Is this what you are looking for ("separator" instead of "operator")? If so, I believe that there's yet another option: instead of "hardcoding" that separator (to, for example, a comma (,) sign), use G (for "group") and D (for "decimal") separators:
    Code:
    SQL> select to_char(123456789 / 100, '999,999,990.00') one_option,
      2         to_char(123456789 / 100, '999G999G990D00') another_option
      3  from dual;
    
    ONE_OPTION      ANOTHER_OPTION
    --------------- ---------------
       1,234,567.89    1,234,567.89

  4. #4
    Join Date
    Aug 2008
    Posts
    464
    Thanks a lot. Yes I was asking about the thousandth separator. However, not quite sure I get ur point. If I have a simple query which returns 50000:

    Code:
    SELECT TRUNC(A.DATETIME,'HH') datetime, 
    
    SUM(COUNTER1) ABC
                        
    FROM schema.table A
    
    WHERE A.DATETIME between trunc(sysdate,'dd')-1 and trunc(sysdate,'dd')-1/3600
    How can I get the result to include the thousandsth separator?

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Just like people told you in your previous topic.

  6. #6
    Join Date
    Aug 2008
    Posts
    464
    Thanks a lot. Got it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •