Search code examples
sqloracle-databaseselectsql-likecase-insensitive

Case Insensitive search in oracle 12g


I have count query, which should counts the total number of records corresponding to the displayed list, I am using like to filter out the record by matching the freetext, record exists in the table but still, query count is 0.

What I did, I supplied the text abc in the search box, but inside table the data is stored in the uppercase i,e ABC.

I want a method for case insensitive search.

QUERY:

SELECT
    COUNT(calender_id)
FROM
    calender s
    LEFT JOIN userdetail uu ON update_by = uu.user_id
WHERE
    calender_id = calender_id
     AND LOWER(s.details) LIKE 'Abc%'

Solution

  • You can try below

    SELECT
        COUNT(calender_id)
    FROM
        calender s
        LEFT JOIN userdetail uu ON update_by = uu.user_id
    WHERE
        calender_id = calender_id
         AND LOWER(s.details) LIKE lower('Abc')||'%'