Maison > base de données > tutoriel mysql > mysql-报Subquery returns more than 1 row求解决,紧急,紧急!!!

mysql-报Subquery returns more than 1 row求解决,紧急,紧急!!!

WBOY
Libérer: 2016-06-06 09:35:32
original
2728 Les gens l'ont consulté

mysql

SELECT
*
FROM
mr_user_info u,mr_visit_info f,
(
SELECT
CASE
WHEN v.RELATION_TYPE = 2 THEN
(
select io.VISIT_ID from mr_visit_info io,mr_item_info_fb aa where io.RELATION_ID = aa.ITEM_ID and aa.ORG_ID = '001' and v.VISIT_ID = io.VISIT_ID
)

WHEN v.RELATION_TYPE = 1 THEN
(select vq.VISIT_ID from mr_beauty_org_info_fb bof,mr_visit_info vq where vq.RELATION_ID = bof.org_id AND bof.org_id = '001')
when v.RELATION_TYPE = 3 THEN
(select vq.VISIT_ID from mr_visit_info vq,mr_doc_info_fb doc where doc.org_id = '001' and doc.doc_id = vq.RELATION_ID)
END vid,
CASE
WHEN v.RELATION_TYPE = 1 THEN
(SELECT
fb.ORG_NAME
FROM
bione_org_info fb,mr_visit_info v,mr_beauty_org_info_fb bp
WHERE
v.RELATION_ID = bp.org_id and fb.org_no = bp.org_id and bp.ORG_ID = '001'
)
WHEN v.RELATION_TYPE = 2 THEN
(
SELECT
i.ITEM_NAME
FROM
mr_item_info_fb i,mr_visit_info v
WHERE
v.RELATION_ID = i.ITEM_ID and i.ORG_ID = '001'
)
WHEN v.RELATION_TYPE = 3 THEN
(
SELECT
b.TRUE_NAME
FROM
mr_doc_info_fb b,mr_visit_info v
WHERE
v.RELATION_ID = b.doc_id and b.ORG_ID = '001'
)
END visitName
FROM
mr_visit_info v
) ff
WHERE
ff.vid = f.visit_id
and f.user_id = u.user_id
AND f.relation_id != '0'

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal