 LEFT JOIN review ON user_review.review_id=review.id
 LEFT JOIN restaurant ON user_review.restaurant_id=restaurant.id
 LEFT JOIN rating_explicit ON user_review.rating_explicit_id=rating_explicit.id
-WHERE EXISTS (
-	SELECT 1 FROM bi_restaurant
-	WHERE bi_restaurant.id=restaurant_id
-)
+-- WHERE EXISTS (
+-- 	SELECT 1 FROM bi_restaurant
+-- 	WHERE bi_restaurant.id=restaurant_id
+-- )
+INNER JOIN bi_restaurant ON bi_restaurant.id=restaurant_id
 INTO OUTFILE '/tmp/user_review_full.csv' FIELDS ESCAPED BY '"' TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';

-- INSERT require ids
INSERT INTO bi_restaurant(id)
SELECT id FROM restaurant
WHERE lat BETWEEN 22.311962 AND 22.324885 AND lng BETWEEN 114.166200 AND 114.173131;

INSERT INTO bi_user(id)
SELECT DISTINCT user_id FROM (

FROM user_love
INNER JOIN user ON user_id=user.id
INNER JOIN label ON label_id=label.id
-- WHERE EXISTS (
-- 	SELECT 1 FROM bi_user
-- 	WHERE bi_user.id=user_id
-- )
INNER JOIN bi_user ON bi_user.id=user_id
INTO OUTFILE '/tmp/user_love.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n';

-- USER - RESTAURANT
