求大神帮忙、感激不尽。
现在碰到如下问题 、 需要查询几个平台下的全部店铺 (一个平台下有若干个店铺) 、使用如下语句 。
SELECT
`paipai_shop`.`sellerUin` AS `shopId`,
`paipai_shop`.`shopName` AS `shopName`
FROM
`paipai_shop`
UNION ALL
SELECT
`dangdang_shop`.`id` AS `shopId`,
`dangdang_shop`.`shopName` AS `shopName`
FROM
`dangdang_shop`
UNION ALL
SELECT
`vjia_shop`.`id` AS `shopId`,
`vjia_shop`.`shopName` AS `shopName`
FROM
`vjia_shop`
UNION ALL
SELECT
`amazon_shop`.`id` AS `shopId`,
`amazon_shop`.`shopName` AS `shopName`
FROM
`amazon_shop`
UNION ALL
SELECT
`taobao_shop`.`shopId` AS `shopId`,
`taobao_shop`.`nick` AS `shopName`
FROM
`taobao_shop`
UNION ALL
SELECT
`jingd_shop`.`shopId` AS `shopId`,
`jingd_shop`.`shopName` AS `shopName`
FROM
`jingd_shop`
UNION ALL
SELECT
`yhd_shop`.`shopId` AS `shopId`,
`yhd_shop`.`shopName` AS `shopName`
FROM
`yhd_shop`
SELECT
`paipai_shop`.`sellerUin` AS `shopId`,
`paipai_shop`.`shopName` AS `shopName`
FROM
`paipai_shop`
UNION ALL
SELECT
`dangdang_shop`.`id` AS `shopId`,
`dangdang_shop`.`shopName` AS `shopName`
FROM
`dangdang_shop`
UNION ALL
SELECT
`vjia_shop`.`id` AS `shopId`,
`vjia_shop`.`shopName` AS `shopName`
FROM
`vjia_shop`
UNION ALL
SELECT
`amazon_shop`.`id` AS `shopId`,
`amazon_shop`.`shopName` AS `shopName`
FROM
`amazon_shop`
UNION ALL
SELECT
`taobao_shop`.`shopId` AS `shopId`,
`taobao_shop`.`nick` AS `shopName`
FROM
`taobao_shop`
UNION ALL
SELECT
`jingd_shop`.`shopId` AS `shopId`,
`jingd_shop`.`shopName` AS `shopName`
FROM
`jingd_shop`
UNION ALL
SELECT
`yhd_shop`.`shopId`+100 AS `shopId`,
`yhd_shop`.`shopName` AS `shopName`
FROM
`yhd_shop`