List:General Discussion« Previous MessageNext Message »
From:Grega LeskovÅ¡ek Date:October 16 2011 11:42am
Subject:[MYSQL] INTERSECT, MINUS
View as plain text  
WHat is wring with the following three sentences?

SELECT p.name, p.gender, e.pizza FROM Person p, Eats e WHERE p.name =
e.name AND p.gender = 'female' AND (e.pizza = 'mushroom')
INTERSECT
SELECT p.name, p.gender, e.pizza FROM Person p, Eats e WHERE p.name =
e.name AND p.gender = 'female' AND (e.pizza = 'pepperoni');


SELECT * FROM Person MINUS SELECT * FROM Person WHERE name='Amy';


mysql> SELECT name FROM Person MINUS SELECT name FROM Person WHERE Person.age <
18;

I've tried my first time sets and am not sure where is the problem,
I've tried to google but when translating to my db it just doesn't
work,
You can download the create db sql here:
http://s3.amazonaws.com/dbclass-resources/docs/pizza.sql

♥♥♥ When the sun rises I receive and when it sets I forgive!
♥♥♥
˜♥ -> http://moj.skavt.net/gleskovs/ <- ♥ Always, Grega
Leskovšek
Thread
[MYSQL] INTERSECT, MINUSGrega LeskovÅ¡ek16 Oct
  • Re: [MYSQL] INTERSECT, MINUSSuresh Kuna16 Oct