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 ...
User Profile
Collapse
-
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.Leave a comment:
-
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.Leave a comment:
-
If you want to have a single-quote inside a literal string, use two consecutive single quotes, like this:
values( 1,'D''Alessio', 'Maria')...Leave a comment:
-
Sort rows descending on salary and add the 'Fetch first 3 rows only' clauseLeave a comment:
-
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....Leave a comment:
No activity results to display
Show More
Leave a comment: