Title: LIKE operator in Sqlite, except Space character
Tags: database;sqlite
Question: I want to write a SELECT command that the Space character was not important.
for example
My data
-------
A E F E
ABC DEF
And my answer should be this:
A E F E
it means "I want all the 4length word that start with 'A' and the space character is not important".
How can I write this SELECT command???

Here is the accepted answer: You can split the condition in two, one for starting with A and one for the length.
You can use REPLACE to remove the spaces and just check the length of the remaining characters.
SELECT *
FROM mytable
WHERE mydata LIKE 'A%'
AND LENGTH(REPLACE(mydata, ' ', '')) = 4;
An SQLfiddle to test with.
Comment for this answer: Tnx, But this answer is without Space, I want to Check without Space but answer "with" space.
Comment for this answer: Got it... WHERE **REPLACE(mydata, ' ', '') LIKE 'A___'**
Comment for this answer: @MehdiKhademloo I'm not sure I understand, what space is missing if you look at the SQLfiddle?


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:05/11/14', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<database><sqlite>', 'Title': 'LIKE operator in Sqlite, except Space character', 'ViewCount': 805, 'id': 23592729, 'user_AboutMe': '<p>please delete me</p>\n', 'user_AccountId': 1829161.0, 'user_DisplayName': 'a d', 'user_Reputation': 542.0, 'user_Views': 116.0, 'user_id': 1661105.0}}