sql-like Questions

4

Solved

I've written a simple query for searching a keyword in the database. $keyword = "keyword sample"; $keyword = str_replace(" ", "%", $keyword); $this->db->selec...
Afrit asked 20/3, 2014 at 20:21

8

I'm trying to query a like statement across multiple columns. I have the following search terms: 'dog' 'cat' 'rabbit' 'gerbil' 'guinea pig' 'hamster' and I need search for these terms or terms LIK...
Lentamente asked 6/3, 2017 at 16:27

2

Solved

Is there any way to do an accent-insensitive LIKE query in SQLite? For example, this query: SELECT * FROM users WHERE name LIKE "Andre%" would return: André the Giant Andre Agassi etc. I'm u...
Terbecki asked 23/12, 2012 at 6:59

4

I have character varying entries in a table where some (not all) values contain percentages, e.g., '12%', '97%', etc. I want to find all the values that contain percentages. In other words, I want ...
Cyrie asked 8/10, 2015 at 5:15

3

Solved

I'm having some trouble searching for any similar match in two fields. For example I have a table with the values: CAR MAKE CAR MODEL Ford Mustang (Shelby) Toyota Corolla Seat Leon etc etc. I wan...
Acanthocephalan asked 20/8, 2011 at 3:7

6

Solved

I am pretty new to SQL and hope someone here can help me with this. I have a stored procedure where I would like to pass a different value depending on whether a column contains a certain country...
Dethrone asked 7/5, 2014 at 9:26

10

I am trying to write a JPQL query with a like clause: LIKE '%:code%' I would like to have code=4 and find 455 554 646 ... I cannot pass :code = '%value%' namedQuery.setParameter("%" + this....
Aime asked 27/8, 2009 at 13:29

6

Solved

I have the following code: const string Sql = @"select distinct [name] from tblCustomers left outer join tblCustomerInfo on tblCustomers.Id = tblCustomerInfo.CustomerId where (tblCustomer....
Scaremonger asked 20/3, 2009 at 5:58

16

Solved

Is there any way to write case-insensitive queries in PostgreSQL, E.g. I want that following 3 queries return same result. SELECT id FROM groups where name='administrator' SELECT id FROM groups w...
Heavily asked 10/8, 2011 at 2:42

9

Solved

So 'awesome document' LIKE '%doc%' is true, because doc is a sub-string. But, I want it to be false while 'awesome doc' or 'doc awesome' or 'awesome doc awesome' should be true. How can I do with w...
Dogvane asked 8/6, 2011 at 18:56

8

Solved

I have a stored procedure that uses the LIKE operator to search for a truck location among some other parameters @location nchar(20), @time time, @date date AS select DonationsTruck.Vechile...
Cwm asked 5/5, 2013 at 0:20

47

Solved

I want to query something with SQL's like query: SELECT * FROM users WHERE name LIKE '%m%' How can I achieve the same in MongoDB? I can't find an operator for like in the documentation.
Skill asked 22/7, 2010 at 3:19

5

Consider this sample: CREATE TABLE #tempTable (name nvarchar(MAX)) INSERT INTO #tempTable VALUES (N'إِبْرَاهِيمُ'), (N'إبراهيم') SELECT * FROM #tempTable WHERE name = N'إبراهيم' SELECT * FROM #t...
Innervate asked 3/3, 2016 at 17:23

11

I'm using this query to get some specific data: "select * from emp where emp_name LIKE 's%'"; emp_nam is character field. How can I use the same logic condition with numeric field? Somet...
Welty asked 10/7, 2009 at 7:24

6

Solved

I have 10,001 rows in my table, and all of the rows except one start with a number. I need to find this one row that doesn't start with a number, or even that doesn't contain a number. So this is ...
Amundsen asked 16/11, 2010 at 2:13

7

Solved

I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is...
Brioche asked 26/3, 2010 at 21:10

5

I have a field in one of my tables that contains this string: !"#¤%&/()=?´`?=)(/&%¤#"!\'\'"' (Only for test purposes ofcourse). I've tried endless of queries to properly select this fiel...
Newlywed asked 6/9, 2011 at 22:54

2

Solved

I have a database with several fields : word_id — INTEGER PRIMARY_KEY word — TEXT ... And ~150k rows. Since this is a dictionary, I'm searching for a word with mask 'search_string%' using LIKE. It...
Bazluke asked 21/12, 2011 at 2:41

5

I have following data in table: +----------------------+----------------------------------------------------------+--------------+ | subscriber_fields_id | name | field_type | +-------------------...
Send asked 9/3, 2015 at 9:43

3

Solved

I am trying to run the following query in Snowflake: SELECT * FROM chapters WHERE title NOT LIKE ANY ('Summary%', 'Appendix%') but it errors out. I know Snowflake support LIKE ANY query syntax....
Cog asked 13/1, 2020 at 5:4

13

Solved

in MySQL select * from record where register_date like '2009-10-10%' What is the syntax in SQL Server?
Ecotone asked 27/10, 2009 at 6:31

4

Solved

I have this table in SQL Server 2012: Id INT DomainName NVARCHAR(150) And the table have these DomainName values google.com microsoft.com othersite.com And this value: mail.othersite.com ...
Lait asked 20/8, 2014 at 20:18

8

Solved

I'm having a hard time getting some sql in python to correctly go through MySQLdb. It's pythons string formatting that is killing me. My sql statement is using the LIKE keyword with wildcards. I'v...
Travers asked 28/6, 2010 at 17:33

5

Solved

Using Sequel Pro, I have these two tables: Table1 Name Year x y John Smith 2010 10 12 Adam Jones 2010 8 13 John Smith 2011 7 15 Adam Jones 2011 9 14 etc. and Table2 Name Year z Smith John S...
Mentally asked 24/4, 2014 at 17:55

9

Solved

I have the following data in a Table PriceOrderShipped PriceOrderShippedInbound PriceOrderShippedOutbound In SQL I need to write a query which searches for a string in a table. While searching for ...
Emporium asked 18/4, 2013 at 12:9

© 2022 - 2025 — McMap. All rights reserved.