Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Not Exists #58

Open
Njanderson opened this issue Oct 17, 2017 · 0 comments
Open

Feature request: Not Exists #58

Njanderson opened this issue Oct 17, 2017 · 0 comments

Comments

@Njanderson
Copy link

I would expect the following queries to be comparable, but alas I think NOT EXISTS does not parse.

schema sch_flights(fid:int,
    year:int,
	month_id:int,
	day_of_month:int,
	day_of_week_id:int,
	carrier_id:int,
	flight_num:int,
	origin_city:int,
	origin_state:int,
	dest_city:int,
	dest_state:int,
	departure_delay:int,
	taxi_out:int,
	arrival_delay:int,
	canceled:int,
	actual_time:int,
	distance:int
);

schema sch_carriers
(
	cid:int,
	name:int
);

SCHEMA sch_months
(
	mid:int,
	month:int
);

SCHEMA sch_days
(
	did:int,
	day_of_week:int
);

table Flights(sch_flights);
table Carriers(sch_carriers);
table Weekdays(sch_days);
table Months(sch_months);

query q1 `select distinct F1.origin_city as orig from Flights F1
where not exists(	select * from Flights F2
					where F2.actual_time >= 180
					and F2.origin_city = F1.origin_city )`;

query q2                -- define query q2 likewise
`select distinct F1.origin_city as orig
from Flights F1
where not exists(	select * from Flights F2
					where F2.actual_time >= 180
					and F2.origin_city = F1.origin_city )`;

verify q1 q2;           -- does q1 equal to q2?
@Njanderson Njanderson changed the title Not Exists Feature request: Not Exists Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant