Splitting rows and subquery in mysql
First of all, I have 1 table in the database.
1) tags:
id name
1 theme1=test1
2 theme1=test2
3 theme1=test3
4 theme2=test1
5 theme2=test2
6 theme2=test3
And I have a set id
of tags
in an array. like 1.3.
Now
1) select name from tags where id = 1
result: theme1 = test1
(now using wildcard)
2) select id from tags where name like 'theme_test1'
result: 1.4
(here 'theme_test1' should be taken from query1)
I am getting the output correctly, but I need to use 2 queries. I want to do this in one request.
thank
+3
source to share
4 answers