al salam alikum =)
guys i want to know how to fix a complicated query
i have two tables
subsystem -> 1st table
topics -> 2nd table
subsystem :
subid
userid
type
typeid ;
topics :
topicid
title
catid
userid ;
and i got 3 records ( for example ) in the subsystem table like thie
1 - 1 - user - 1
2 - 1 - user - 2
3 - 1 - cat - 1
and i wanna to fetch the topics from topics table like this
query > select * from topics inner join subsystem on topics.userid=subsystem.userid where ( and here is the problem ! i want to fetch the topics where subsystem.typeid=userid "if subsystem.type=user" and where subsystem.typeid=catid "if subsystem.type=cat")
can anybody help !
and thnx =)
guys i want to know how to fix a complicated query
i have two tables
subsystem -> 1st table
topics -> 2nd table
subsystem :
subid
userid
type
typeid ;
topics :
topicid
title
catid
userid ;
and i got 3 records ( for example ) in the subsystem table like thie
1 - 1 - user - 1
2 - 1 - user - 2
3 - 1 - cat - 1
and i wanna to fetch the topics from topics table like this
query > select * from topics inner join subsystem on topics.userid=subsystem.userid where ( and here is the problem ! i want to fetch the topics where subsystem.typeid=userid "if subsystem.type=user" and where subsystem.typeid=catid "if subsystem.type=cat")
can anybody help !
and thnx =)