User Profile

Collapse

Profile Sidebar

Collapse
ties
ties
Last Activity: Nov 4 '07, 11:31 PM
Joined: Nov 2 '07
Location: Laren, Netherlands
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • The only obvious thing I can see is the single quotes around ( and ) characters.
    Do not use quotes here.
    So it should be: .. digits(upc_no)
    and: ... not exists ( select ...
    See more | Go to post

    Leave a comment:


  • ties
    replied to SQL Replace Function Problems
    in DB2
    Try using a 'CASE' expression.

    In your example it would go something like:

    SELECT
    col1,
    CASE col2
    WHEN <value1> THEN '<description1> '
    WHEN <value2> THEN '<description2> '
    ...
    END
    FROM ...

    You can do a lot more with CASE, but this should answer your question.
    See more | Go to post

    Leave a comment:


  • ties
    replied to monitoring
    in DB2
    update monitor switches ...
    is not a query, it is a db2 command to switch on or off the things you want db2 to monitor.
    Useful if you want to see what is going on inside using the get snapshot command.
    See more | Go to post

    Leave a comment:


  • ties
    replied to Problem string with literals
    in DB2
    If you want to have a single-quote inside a literal string, use two consecutive single quotes, like this:
    values( 1,'D''Alessio', 'Maria')...
    See more | Go to post

    Leave a comment:


  • ties
    replied to Needed SQL
    in DB2
    Sort rows descending on salary and add the 'Fetch first 3 rows only' clause
    See more | Go to post

    Leave a comment:


  • ties
    replied to Please help to optimize the SQL Query
    in DB2
    To be helpfull you have to give extra information:
    1. Are there any indexes on tables b, c and d (index on join column can really help!) ?
    2. Size of tables (approximate number of rows)

    As a firstsuggestion : move the a.AGENT_CODE not like '%00007' condition to the start of the where clause. If that condition is false, the rest does not have to be evaluated....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...