update urlnum u set num=(SELECT COUNT(*) FROM js_chat_record WHERE REFER_PAGE LIKE '%'||(select t.url from urlnum t )||'%' AND to_char(CREATE_TIME,'yyyy-mm-dd') BETWEEN '2014-07-01' AND '2014-08-01' and effective >0)
我现在有两个表,一个表里的所有连接匹配另一个表里的连接,查看有多少个。但是无法返回多行。之前用mysql数据库使用的concat函数,但是orcale里不会用。请高手帮忙。
------解决方案--------------------
update urlnum u
set num =
(SELECT COUNT(*)
FROM js_chat_record
WHERE REFER_PAGE LIKE '%'
------解决方案--------------------
u.url
------解决方案--------------------
'%'
AND to_char(CREATE_TIME, 'yyyy-mm-dd') BETWEEN '2014-07-01' AND
'2014-08-01'
and effective > 0);
------解决方案--------------------
可以试一下用EXISTS条件。
UPDATE
URLNUM
SET
NUM = (
SELECT COUNT(*) CNT
FROM JS_CHAT_RECORD J
WHERE EXISTS (
SELECT NULL
FROM URLNUM T
WHERE J.REFER_PAGE LIKE '%'
------解决方案--------------------
T.URL
------解决方案--------------------
'%'
AND TO_CHAR(CREATE_TIME,'yyyy-mm-dd') BETWEEN '2014-07-01' AND '2014-08-01'
AND EFFECTIVE > 0
)
);