Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
26.01.2010, 08:14
|
|||
---|---|---|---|
|
|||
Операция "умножения" в SQL DB2 |
|||
#18+
Здравствуйте, подскажите пожалуйста как в DB2 выполнять математические операции в sql-скриптах. Ниже представлен пример по умножению: SELECT prod_id, quantity, item_price quantity*item_price AS expanded_price FROM OrderItems WHERE order nam = 20008; ------------------------------------------------------------------------------ SELECT prod_id, quantity, item_price quantity*item_price AS expanded_price FROM OrderItems WHERE order nam = 20008 SQL0104N An unexpected token "*" was found following "item_price quantity". Expected tokens may include: ",". SQLSTATE=42601 SQL0104N An unexpected token "*" was found following "item_price quantity". Expected tokens may include: ", ". Explanation: A syntax error in the SQL statement was detected at the specified token following the text "<text>". The "<text>" field indicates the 20 characters of the SQL statement that preceded the token that is not valid. As an aid to the programmer, a partial list of valid tokens is provided in the SQLERRM field of the SQLCA as "<token-list>". This list assumes the statement is correct to that point. The statement cannot be processed. User Response: Examine and correct the statement in the area of the specified token. sqlcode : -104 sqlstate : 42601 ... |
|||
:
Нравится:
Не нравится:
|
|||
|
26.01.2010, 09:41
|
|||
---|---|---|---|
|
|||
Операция "умножения" в SQL DB2 |
|||
#18+
Добрый день. make123подскажите пожалуйста как в DB2 выполнять математические операции в sql-скриптах. Ниже представлен пример по умножению: SELECT prod_id, quantity, item_price, quantity*item_price AS expanded_price FROM OrderItems WHERE order nam = 20008; ------------------------------------------------------------------------------ SELECT prod_id, quantity, item_price quantity*item_price AS expanded_price FROM OrderItems WHERE order nam = 20008 SQL0104N An unexpected token "*" was found following "item_price quantity". Expected tokens may include: ",". SQLSTATE=42601 SQL0104N An unexpected token "*" was found following "item_price quantity". Expected tokens may include: ", ". ...Пропущена запятая. Кроме того, если у вас действительно поле 'order nam' заведено с пробелом, то его надо в двойные кавычки заключать. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/topic.php?fid=43&mobile=1&tid=1602929]: |
0ms |
get settings: |
8ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
37ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
68ms |
get tp. blocked users: |
1ms |
others: | 240ms |
total: | 385ms |
0 / 0 |