Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

sql-like

Is the LIKE operator case-sensitive with SQL Server?

December 21, 2022 by Tarik

It is not the operator that is case sensitive, it is the column itself. When a SQL Server installation is performed a default collation is chosen to the instance. Unless explicitly mentioned otherwise (check the collate clause bellow) when a new database is created it inherits the collation from the instance and when a new … Read more

Categories sql Tags sql, sql-like, sql-server-2005, varchar Leave a comment

List of special characters for SQL LIKE clause

December 11, 2022 by Tarik

For SQL Server, from http://msdn.microsoft.com/en-us/library/ms179859.aspx : % Any string of zero or more characters. WHERE title LIKE ‘%computer%’ finds all book titles with the word ‘computer’ anywhere in the book title. _ Any single character. WHERE au_fname LIKE ‘_ean’ finds all four-letter first names that end with ean (Dean, Sean, and so on). [ ] … Read more

Categories sql Tags special-characters, sql, sql-like Leave a comment

PostgreSQL LIKE query performance variations

November 30, 2022 by Tarik

FTS does not support LIKE The previously accepted answer was incorrect. Full Text Search with its full text indexes is not for the LIKE operator at all, it has its own operators and doesn’t work for arbitrary strings. It operates on words based on dictionaries and stemming. It does support prefix matching for words, but … Read more

Categories sql Tags indexing, pattern-matching, postgresql, sql, sql-like Leave a comment

What is Full Text Search vs LIKE

November 13, 2022 by Tarik

In general, there is a tradeoff between “precision” and “recall”. High precision means that fewer irrelevant results are presented (no false positives), while high recall means that fewer relevant results are missing (no false negatives). Using the LIKE operator gives you 100% precision with no concessions for recall. A full text search facility gives you … Read more

Categories sql Tags full-text-search, sql, sql-like Leave a comment

SQL- Ignore case while searching for a string

October 23, 2022 by Tarik

Use something like this – SELECT DISTINCT COL_NAME FROM myTable WHERE UPPER(COL_NAME) LIKE UPPER(‘%PriceOrder%’) or SELECT DISTINCT COL_NAME FROM myTable WHERE LOWER(COL_NAME) LIKE LOWER(‘%PriceOrder%’)

Categories sql Tags case-insensitive, ignore-case, sql, sql-like, sql-server Leave a comment

MySQL Like multiple values

October 21, 2022 by Tarik

Faster way of doing this: WHERE interests LIKE ‘%sports%’ OR interests LIKE ‘%pub%’ is this: WHERE interests REGEXP ‘sports|pub’ Found this solution here: http://forums.mysql.com/read.php?10,392332,392950#msg-392950 More about REGEXP here: http://www.tutorialspoint.com/mysql/mysql-regexps.htm

Categories mysql Tags mysql, sql, sql-like Leave a comment

Case insensitive searching in Oracle

October 5, 2022 by Tarik

There are 3 main ways to perform a case-insensitive search in Oracle without using full-text indexes. Ultimately what method you choose is dependent on your individual circumstances; the main thing to remember is that to improve performance you must index correctly for case-insensitive searching. 1. Case your column and your string identically. You can force … Read more

Categories sql Tags case-insensitive, case-sensitive, oracle, sql, sql-like Leave a comment

LIKE vs CONTAINS on SQL Server

October 4, 2022 by Tarik

The second (assuming you means CONTAINS, and actually put it in a valid query) should be faster, because it can use some form of index (in this case, a full text index). Of course, this form of query is only available if the column is in a full text index. If it isn’t, then only … Read more

Categories sql-server Tags contains, performance, sql-like, sql-server Leave a comment

How can I escape square brackets in a LIKE clause?

October 2, 2022 by Tarik

LIKE ‘WC[[]R]S123456’ or LIKE ‘WC\[R]S123456’ ESCAPE ‘\’ Should work.

Categories sql-server Tags character, escaping, sql-like, sql-server, tsql Leave a comment

Equals(=) vs. LIKE

September 26, 2022 by Tarik

Different Operators LIKE and = are different operators. Most answers here focus on the wildcard support, which is not the only difference between these operators! = is a comparison operator that operates on numbers and strings. When comparing strings, the comparison operator compares whole strings. LIKE is a string operator that compares character by character. … Read more

Categories sql Tags equals, performance, sql, sql-like Leave a comment
Older posts
Newer posts
← Previous Page1 … Page5 Page6 Page7 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa