MYSQL嵌套查询的问题
错误SQL语句:SELECTcustomers_id,customers_lastname,customers_firstname,customers_email_add...
错误
SQL 语句 :
SELECT customers_id, customers_lastname, customers_firstname, customers_email_address
FROM osc_customers
where EXISTS (
select *
FROM osc_money_account
where osc_money_account.customers_id = osc_customers.customers_id
)
ORDER BY c.customers_lastname, c.customers_firstname
LIMIT 30
MySQL 返回:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS(select * FROM osc_money_account where osc_money_account.
这里为什么会是错误的阿。。。。求个位高手赐教! 展开
SQL 语句 :
SELECT customers_id, customers_lastname, customers_firstname, customers_email_address
FROM osc_customers
where EXISTS (
select *
FROM osc_money_account
where osc_money_account.customers_id = osc_customers.customers_id
)
ORDER BY c.customers_lastname, c.customers_firstname
LIMIT 30
MySQL 返回:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXISTS(select * FROM osc_money_account where osc_money_account.
这里为什么会是错误的阿。。。。求个位高手赐教! 展开
展开全部
SELECT customers_id, customers_lastname, customers_firstname, customers_email_address
FROM osc_customers c
where EXISTS (
select 1
FROM osc_money_account
where osc_money_account.customers_id = osc_customers.customers_id
)
ORDER BY c.customers_lastname, c.customers_firstname
LIMIT 30
FROM osc_customers c
where EXISTS (
select 1
FROM osc_money_account
where osc_money_account.customers_id = osc_customers.customers_id
)
ORDER BY c.customers_lastname, c.customers_firstname
LIMIT 30
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询