Hi,
I have a requirement where we get data something like this from 2 tables
Tag and value are 2 columns.
tag Value
==== =====
Color RED
Color GREEN
Color BLUE
Theme PARTY
Theme Diwali
Theme Christmas
Theme Holi
Now,
If I pass red to the query, it must remove all the color tags and it should return something like this:
tag Value
==== =====
Color RED
Theme PARTY
Theme Diwali
Theme Christmas
Theme Holi
I was looking for a SQL query to show a single matched row for the column data.
Just in the above example, When I pass Red to the value column(and also color to the Tag column), Nothing should change, except all the color tags rows must be removed except the one i selected. rest of the data remains same.
this data is being shared from 2 tables.
and the query to retrieve data will be something like this.
SELECT DISTINCT Make.tag, fest.value FROM Make JOIN fest ON make.ID = fest.ID
WHERE (fest.ID IS NOT NULL) and ( not fest.ID = '') AND
( Make.tag = 'color' OR Make.tag = 'Theme') ORDER BY Make.tag, fest.ID;
Thank you!