Tag system implementation
来源:互联网 发布:js密码和确认密码校验 编辑:程序博客网 时间:2024/05/17 00:57
Use RDBMS
Give below 2 tables:
Table: BOOK
Table: TAG
If we want to get the books which both have WEB and PHP tag, we need below SQL:
SELECT T1.BOOK_ID FROM TAG T1 INNER JOIN TAG T2 ON T1.BOOK_ID=T2.BOOK_ID AND T1.TAG_NAME='WEB' AND T2.TAG_NAME='PHP';
Use Redis
prepare the data:
set book;;bookid;;1;;title JAVAset book;;bookid;;2;;title RUBYset book;;bookid;;3;;title PYTHONset book;;bookid;;4;;title PHPset book;;bookid;;5;;title OBJECTIVE-Cset book;;bookid;;6;;title SWIFTsadd tag;;WEB 1 2 3 4sadd tag;;APPLE 5 6sadd tag;;PHP 4
To get the book both have WEB and PHP tag, use below command:
sinter tag;;WEB tag;;PHP> 4
e.g. for sinter:
key1 = {a,b,c,d}key2 = {c}key3 = {a,c,e}SINTER key1 key2 key3 = {c}
To get the book either have WEB or PHP tag, use below command:
sunion tag;;WEB tag;;PHP> 1 2 3 4
e.g. for sunion:
key1 = {a,b,c,d}key2 = {c}key3 = {a,c,e}SUNION key1 key2 key3 = {a,b,c,d,e}
0 0
- Tag system implementation
- Database System Implementation
- Database System Implementation ch2
- the implementation of system call in linux
- Reading Notes of Database System Implementation
- Database system implementation 名词,缩略词
- Implementation
- implementation
- GNU GLOBAL source code tag system
- System.out.println(((Parent)d).tag);
- Solaris Source Insight: PCI system implementation - Part 1
- Solaris Source Insight: PCI system implementation - Part 2
- Solaris Source Insight: PCI system implementation - Part 3
- Solaris Source Insight: PCI system implementation - Part 4
- Linux AuFS Examples: Another Union File System Tutorial (UnionFS Implementation)
- The design and Implementation of a Log-Structured File System
- Design and Implementation of the Sun Network File System
- Bigtable: A Distributed Storage System for Structured Data : part5 Implementation
- SVG 在线编辑器
- Oracle之常用FAQ--备份与恢复
- API中的对象Runtime
- C++primer plus第六版课后编程练习答案2.7
- 使用android SpannableStringBuilder实现图文混排源码
- Tag system implementation
- Summary of problems when coding
- 统计一个文件中的字符数,单词数,制表符。
- 自动换行LinearLayout
- Dropdownlist验证是否选择
- android 修改文本选中默认样式
- 进程与线程的一个简单解释
- 建立一个程序,写2个线程,同时对一个文件里面写入字符串,另外一个程序读取输出在控制台,保证读取的实时性。
- Cocos2d-x 常用语句