2014-09-09 4 views
0

Android 및 SQL의 새로운 기능이며 해결 방법을 모르는 다음과 같은 문제가 있습니다. 데이터가 존재하지 않는 경우 Android Sqlite

나는 아래 표를

users 
id, name 
1, user 1 

articles 

id, article_text 
1, test article 


comments 
article_id, users_id, article_comment 
1   , 1 , test comment 1 
2   , 2 , test comment 2  

나는 위의 쿼리를이

select users.*, comments.* from Comments, users where users_id = user._id 

문제와 같은 모든 의견은 내가 두 번째 코멘트 "테스트 코멘트 (2)를 얻을 수 없다는 것입니다 수 "사용자 테이블에 사용자가 없기 때문에 도움을받을 수 있습니까?

사용자 테이블에 두 번째 사용자를 삽입 할 수 없습니다.

+0

http://en.wikipedia.org/wiki/Join_(SQL)#Left_outer_join – Tmdean

답변

0
select users.*, comments.* from users LEFT OUTER JOIN Comments where Comments.users_id = user._id 
관련 문제