Home  >  Article  >  Database  >  请教mysql存储过程分割字符串做关联

请教mysql存储过程分割字符串做关联

WBOY
WBOYOriginal
2016-06-06 09:42:211202browse

mysqlsql存储过程数据库

假如有两个表
表一:
id pid
1 pid1,pid2
2 pid2,pid5,pid6
3 pid3
4 pid4,pid1
......

表二:
pid pname
pid1 aaa
pid2 bbb
pid3 ccc
pid4 ddd
pid5 eee
pid6 ggg
......

假如我想要通过存储过程计算表1中包含pname=ddd的记录的行数,按这样的表结构,请教是否可以实现?怎么实现呢?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn