I have searched and cannot find the answers to what I'm trying to achieve. Let's say for example I have this data.
|SN | column1 | column2 | column3 | column4 | column5 | column6 |
+------+-----------+----------+---------+---------+---------+---------+
|1 | orange | banana | apple | grapes | null | 555 |
|2 | banana | grapes | null | null | null | 555 |
|3 | grapes | orange | banana | null | null | 555 |
|4 | orange | banana | grapes | null | null | 555 |
I want a search where all rows have duplicates in any column and where column6 is 555. The results would show grapes and banana regardless of SN column. because 555 exist and grapes exist in every row. see sample results below:
|SN | column1 | column2 | column3 | column4 | column5 | column6 |
+---+-----------+----------+----------+----------+---------+---------+
|1 | orange |**banana**| apple |**grapes**| null | 555 |
|2 |**banana** |**grapes**| null | null | null | 555 |
|3 |**grapes** | orange |**banana**| null | null | 555 |
|4 | orange |**banana**|**grapes**| null | null | 555 |
I have tried to use the count, sample code below but the results is blank.
select column1, column2, column3, column4, column5, COUNT(*)
From Sheet Group By
column1, column2, column3, column4, column5
Having
Count(*) > 1
The output should show me all columns with same value which banana/grapes and 555
Please help!