我有一个表DailyMeal:限制SQL结果
Name | Type
------------------------
orange | fruit
carrot | vegetable
apple | fruit
potato | vegetable
eggplant | vegetable
cucumber | vegetable
lemon | fruit
我的查询应该返回所有的蔬菜,有且仅有一个水果,无所谓哪一个。
单查询可能吗?没有存储过程。
编辑:是的,它是联盟。感谢所有海报。
你应该总是陈述DBMS,如果可能的版本。 – RichardTheKiwi 2011-02-16 18:01:44