使用sqlite有三个不同的搜索结果

I am wanting to show a set of results based on what it's privacy type is.

I am using lavavel 4.2, php, blade and sqlite.

I have public, friends, and private. Public anyone can read, friends only author and friends can read and private only the author can read it.

The site has a log in/ out functionality.

Can this be done with one sqlite query?

Any help is greatly appreciated.

yes, you can do it using UNION ALL to combine the results of multiple queries. here's an example:

SELECT * FROM friends WHERE is_private="1"
UNION ALL
SELECT * FROM friends WHERE is_public="1"
UNION ALL
SELECT * FROM friends WHERE is_mine="1"
GROUP BY friends.user_id -- optionally remove duplicates

please note, -- denotes a comment in SQL