0

We are filtering our record based on two columns group_is and enumeration. We have total 8 groups and 12 enumerations. while processing a filtration for record as group_is like Group 1 and enumeration like Enumeration 1. we get the result which contains all record with group_is like Group 1 and Enumeration like Enumeration 1 as well as enumeration like Enumeration 10,Enumeration 11 and Enumeration 12 also as we have used like in our query. We have used following query in order to get result.

$query = "SELECT * FROM geodata WHERE group_is like 'Group 1%' 
and enumeration like 'Enumeration 1%'";

as we have many other filtration with group and enumerations like batch,site and many other that's why it is important to use like query while processing.

how we can alter query so that we will get result which are only there in Group 1 and Enumeration 1

What we have tried?

we try change our query little bit by changing, instead of using enumeration like 'Enumeration 1%' , we used enumeration='Enumeration 1' . but it doesn't help us. as by changing this we unable to get filtration result for other filter fields.

Syscall
  • 19,327
  • 10
  • 37
  • 52
suhas gawde
  • 39
  • 2
  • 7
  • 1
    Possible duplicate of [SQL table with "list" entry vs SQL table with a row for each entry](http://stackoverflow.com/questions/41215624/sql-table-with-list-entry-vs-sql-table-with-a-row-for-each-entry) – e4c5 Dec 20 '16 at 06:44

1 Answers1

2

Did you try using enumeration in ('Enumeration 1') ?

Daniel_ZA
  • 574
  • 11
  • 26
Sankaran
  • 21
  • 3
  • yes i tried using in with filtration but it affect other filration results. – suhas gawde Dec 20 '16 at 06:54
  • Share the result of the query and your issue. – Kiran Kumar Dec 20 '16 at 08:00
  • if i change the enumeration like to enumeration in , other filtration stop working, i have enumeration 1,....,enumeration 10,...,enumeration 12. the like query filter all result when enumeration 1 is selected in dropdown list – suhas gawde Dec 20 '16 at 08:17