like

MYSQL SELECT LIKE "masks"

Hi guys, I'm using a field in a table to hold information about varios checkboxes (60). The field is parsed to a string to something like this "0,0,0,1,0,1,0,1,..." Now I want to make a search using a similar string to match the fields. I.e. "?,?,1,?,?,1,..." where the "?" means that it must be 0 or 1 (doesn't matter), but the "1...

t-sql LIKE and special characters

"[" is not classed a unicode character http://en.wikipedia.org/wiki/List%5Fof%5FUnicode%5Fcharacters (my guess) as to why this wouldn't work: declare @v nvarchar(255) set @v = '[x]825' select 1 where @v like '[x]825' Ta! ...

MySQL LIKE statement

Hi guys. I have a SQL query SELECT * FROM table WHERE column LIKE '%pdd%'. The problem is I need to get all results excluding those which start with "pdd", I mean find everything where "pdd" is not at the beginning. How could it be done? Thank you. UPD. Sorry, I should've clarified my question a little bit more. I do need to match "p...

mysql join query using like ?

Hey I have been trying to get this working for quite a while now but it just doesn't seem to work, maybe it is is not even possible, what i am wanting to do is to perform a mysql join query using like, such as this example i found... SELECT * FROM Table1 INNER JOIN Table2 ON Table1.col LIKE '%' + Table2.col + '%' but it just doesn't ...

How to search using the LIKE syntax and % WILDCARD % across multiple tables.

How can you use mysql and the like/wildcard syntax across multiple tables, would it be as simple as: (SELECT * FROM `table1` WHERE `name` LIKE '%tom%') AND (SELECT * FROM `table2` WHERE `name` LIKE '%sam%') Not tested, just thinking about it. ...

Using NOT LIKE in Filter property of VBA recordset

I am using excel 2003 to connect to SYBASE database using VBA recordset. I want to filter the records. Following is code I have used. Dim rset As New ADODB.Recordset rset.Open sQuery, m_db, adOpenForwardOnly rset.Filter = "Name NOT LIKE 'Dav%'" rset.Requery But it is not working and returning all rows. If I use Name LIKE 'Dav%', its ...

LIKE Statement trouble

I am having some issues while using the TableAdapter and the LIKE Statement in VB 2008. I am wanting to search name using partial spellings. When I run the application nothing is returned. Here is my SQL: SELECT MEMBERS.RolodexID, MEMBERS.FirstName, MEMBERS.LastName, MEMBERS.address, MEMBERS.Address2, MEMBERS.City, MEMBERS....

how to safely generate a SQL LIKE statement using python db-api

I am trying to assemble the following SQL statement using python's db-api: SELECT x FROM myTable WHERE x LIKE 'BEGINNING_OF_STRING%'; where BEGINNING_OF_STRING should be a python var to be safely filled in through the DB-API. I tried beginningOfString = 'abc' cursor.execute('SELECT x FROM myTable WHERE x LIKE '%s%', beginningOfStrin...

Search problem in mysql query

Hi I have some problem regarding the search in mysql. Below is my query. SELECT * FROM table WHERE name LIKE "%admin\'s%"; When i am executing this query it will return zero data. actually i have "admin\'s" stored in db. this "\" is to prevent sql injection. i have used mysql_real_escape_string to prevent the sql injection. but wh...

using . in LIKE query

When i use . operator in like operator query is not selecting any of the records. here is my query. how to use " . " in LIKE . SELECT * FROM XSP_AssetList_V WHERE AccountID = '5d6b1eab-1697-de11-a2d1-00505617006d' AND PrinterSerialNumber LIKE '%13.12%' ...

how to select two record from two different table with one query in mysql

how to select two record from two different table with one query in mysql?? for a search query im using $search = $_GET['gd'] $arama_sonuc = mysql_query("select * from mp3 where baslik like '%$search%'"); well its ok. it shows me results from mp3 table. but with same query i need to search something on HABERLER table too.. how can i ...

How to search in 5 different fields with all possible choices in no particular order in MySQL using LIKE

Hi, I have a database which contains 5 fields, which are: name, address, idcard, town, street I then have a PHP query which accepts one parameter. In this parameter, you can enter whatever fields you like and the results must still be accurate. For example, if I enter john doe skate street in the search box you will get all the record...

MySQL Select Like

I've got a field in my table for tags on some content, separated by spaces, and at the moment I'm using: SELECT * FROM content WHERE tags LIKE '%$selectedtag%'" But if the selected tag is 'elephant', it will select content tagged with 'bigelephant' and 'elephantblah' etc... How do I get it to just select what I want precisely? Thanks...

Element or class LIKE selector for JQuery?

For whatever reason I have these classes called .main_sub1, .main_sub2 etc. Never mind why I can't have .main .sub. Is there a way with JQuery, sort of in the way it is possible to do with attributes, to get the classes containing main? ...

CREATE TABLE new_table_name LIKE old_table_name with old_table_name's AUTO_INCREMENT values

Hello! Can I create a new table with an old table's autoincriment status in mysql client? I think, that ALTER TABLE new_table_name AUTO_INCREMENT=@my_autoincr_iment helps me, but this construction must use with a constant value. I don't wanna use a difficult script. Drochite na carmu! ...

like Query using plsql database for unicode string.

This gives the correct result select name_en,address_new,ddress2_new,unique_id from mumbaipropertydetails where mumbaipropertydetails."zone"='\\u092E\\u0928\\u092A\\u093E \\u092D\\u0935\\u0928'; but if I use like it does not select name_en,address_new,ddress2_new,unique_id from mumbaipropertydetails where mumbaipropertydetails....

Like and Where in the same MySQL query

I would like to use something like the following: SELECT city FROM cities WHERE city LIKE %D% AND country_id = '12' ...

how to get best search results AND , OR , LIKE

Query #1: SELECT DISTINCT `title` FROM `table` WHERE ( `title` LIKE '%this is search%' ) OR ( `title` LIKE '%this%' AND `title` LIKE '%is%' AND `title` LIKE '%search%' ) OR ( `title` LIKE '%this%' OR `title` LIKE '%is%' OR `title` LIKE '%search%' ) LIMIT 0 , 10 but not works good , and when I try splited this sql: Query #2: SELE...

MySql Searching two tables and comparing columns with like and %

I am trying to select data from two tables and insert it into another one. I want to select the data when certain things match in each table. The problem is that one of the comparisons needs to be a like and I am at a loss. The sql statement is below and I believe that it will at least show what I am trying to do. insert into hr_numb...

adding the value of a column into a LIKE statement?

hi there i have 3 tables for tags, tag categories and used tags. i'm wanting to get a list of all tags with a count of the used tags (the format of the tags used is comma separated values for each document id that has tags). i've been trying something like this but I can't get the value of the tags.tag field to be inserted into the LIK...