Re: Partitioning on a Substring of Varchar Column in Mysql

2012-09-22 Thread Adarsh Sharma
sk in my first can we partition on substring from id column. > > An AUTO_INCREMENT value, say `id` must be the _first_ field in _some_ key. > `id` does not have to be UNIQUE, nor does it have to be the PK. (However, > if you do not have "UNIQUE(`id`)", by itself, it is poss

RE: Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Rick James
PARTITION, yet they have not determined that there will be any benefit. See tips in http://mysql.rjweb.org/doc.php/ricksrots > -Original Message- > From: Adarsh Sharma [mailto:eddy.ada...@gmail.com] > Sent: Friday, September 21, 2012 5:09 AM > To: mysql@lists.mysql.com > Sub

Re: Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Adarsh Sharma
Just update the string needed function substring(id,9,6). On Fri, Sep 21, 2012 at 5:18 PM, Adarsh Sharma wrote: > Hi all, > > I created a partition on a timstamp column ( dt_dtamp ) in mysql-5.1.58 > testing table.But as all of us know that partitioned column need to be > primar

Partitioning on a Substring of Varchar Column in Mysql

2012-09-21 Thread Adarsh Sharma
/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html . Is it possible i can create partitioning on a substring of varchar(255) ( id ) column. Below are the some contents of my id column :- 0038000-120614070130414-sudoie-sudoi-C@86 | | 0038000-120614070130414-sudoie-

RE: Substring confusion.

2011-07-15 Thread Larry McGhaw
at start with "00:" in the criteria .. those times will occur tomorrow. -Original Message- From: Paul Halliday [mailto:paul.halli...@gmail.com] Sent: Friday, July 15, 2011 9:53 AM To: mysql mailing list Subject: Substring confusion. Does anyone know why this happens: mysql> SE

Substring confusion.

2011-07-15 Thread Paul Halliday
Does anyone know why this happens: mysql> SELECT COUNT(*) AS count, SUBSTRING(timestamp,12,5) AS time FROM event WHERE timestamp BETWEEN '2011-07-15 03:00:00' AND '2011-07-16 02:59:59' GROUP BY time ORDER BY time limit 4; +---+---+ | count | time | +---+-

RE: substring query

2010-06-10 Thread Jay Blanchard
[snip] Here is what I came up with. select substring(substring_index(myfile,'.',-2),1,4) AS MyColumn from mydatabase group by MyColumn; That appears to yield what I need. I just need to filter out the results that do not have an extension. [/snip] You can exclude results that do

Re: substring query

2010-06-10 Thread Aaron Savage
Sorry Jay, Here is what I came up with. select substring(substring_index(myfile,'.',-2),1,4) AS MyColumn from mydatabase group by MyColumn; That appears to yield what I need. I just need to filter out the results that do not have an extension. -Aaron On Thu, Jun 10, 2010 at 9:

RE: substring query

2010-06-10 Thread Jay Blanchard
[snip] It may be a little more complicated then I made it out to be. I am just trying to pull out the file extension but there were some conditions I did not list. [/snip] Thank you for that update, would have been good to have from the start. SELECT SUBSTRING_INDEX('my.doc','.',-1) -- MySQL G

Re: substring query

2010-06-10 Thread Aaron Savage
Thanks Guys for you insights. It may be a little more complicated then I made it out to be. I have tried this select substring_index(myfiled,'.',-2) from mytable. This has gotten me to a good starting point. But I still have two problems. After the extension there is a space and more wording.

Re: substring query

2010-06-10 Thread Mark Goodge
On 10/06/2010 16:55, Aaron Savage wrote: I am looking for some guidance on creating a substring query. I have a column that stores a path to a file. I would like to extract that file extension and that is it and display it on my results. However, the paths are different lengths and some

RE: substring query

2010-06-10 Thread Jay Blanchard
[snip] I am looking for some guidance on creating a substring query. I have a column that stores a path to a file. I would like to extract that file extension and that is it and display it on my results. However, the paths are different lengths and some extensions are 3 letter and some are 4

substring query

2010-06-10 Thread Aaron Savage
I am looking for some guidance on creating a substring query. I have a column that stores a path to a file. I would like to extract that file extension and that is it and display it on my results. However, the paths are different lengths and some extensions are 3 letter and some are 4, eq '

Re: Searching Fields for a SubString

2006-11-04 Thread David T. Ashley
Thanks for the help. As often happens in these situations, a little searching and experimentation got me a workable answer before any replies arrived. In my case, I was able to use the LOCATE operator, i.e. select idx, lname,schedalonerscs from usrs where LOCATE(",7,", schedalonerscs) != 0; I'

Re: Searching Fields for a SubString

2006-11-04 Thread Dan Buettner
Dave, you could just use a LIKE statement SELECT * FROM table WHERE mystring LIKE "%,2,%" Of course if it is at the beginning or end, or the only item, it may look like '2' '2,' or ',2' and not ',2,' so this would work in all cases I think: WHERE (mystring LIKE "%,2,%" OR mystring LIKE "2,%" OR

Searching Fields for a SubString

2006-11-04 Thread David T. Ashley
Hi, I'm a little bit lost on MySQL statements. I am implementing a many:many relationship using a string (wrong way, I know, but I'm trying to keep the design simple and this is a trivial application). In a VARCHAR field, I will store a comma-delimited set of integers corresponding to the indic

Longest substring match

2006-01-24 Thread George Law
Hi All, I am working with some call processing. I have one table with call detail records (cdrs) with a phone number in it : 0111234567890 I have another table with rates in it based on the dial number with the 011 stripped off. There may be unique rates for 1234 1235 1236 1237...

Re: MySQL 5.0.13-rc: BUG in substring functions?

2005-10-07 Thread Gleb Paharenko
Hello. Support guys verified this bug. Thank you. See: http://bugs.mysql.com/bug.php?id=13815 Juri Shimon wrote: > Hello All! > > left(),right(),mid(),etc functions > + > with fixed point return value for function (or out parameter for sp) > --- > result has been

MySQL 5.0.13-rc: BUG in substring functions?

2005-10-06 Thread Juri Shimon
Hello All! left(),right(),mid(),etc functions + with fixed point return value for function (or out parameter for sp) --- result has been truncated How to repeat: mysql> drop function if exists test; mysql> drop function if exists test1; mysql> delimiter // mysq

General substring update query required

2005-03-27 Thread zzapper
Hi, I want to replace every occurence of a string with another. The following query works fine (appears to anyway) update tbl_websitepages set page_content=replace (page_content,'develop','bucket'); But is there any way to get any Regexp into the substitution? -- MySQL General Mailing List F

RE: Syntax Failures with SELECT SUBSTRING - Help!

2005-02-03 Thread Gordon
Try SELECT SUBSTRING(AnimalName, 1, 1) MySQL wants the "(" to immediately follow the function i.e. no spaces. -Original Message- From: Sue Cram [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 9:28 AM To: mysql@lists.mysql.com Subject: Syntax Failures with SELECT

Syntax Failures with SELECT SUBSTRING - Help!

2005-02-03 Thread Sue Cram
Neither my developer nor I can figure out this one! The package I'm using is "Animal Shelter Manager" and is written in SQL. Every other installation of the product can use the SELECT SUBSTRING command except mine! I use the following code: SELECT SUBSTRING (AnimalName, 1,

Re: Substring functions in mySQL

2004-09-08 Thread SGreen
e as far as I know) Where do the middle names end and where does the last name begin? Any way, extracting substrings: use the SUBSTRING() function. That is, once you decide where you want to split the string. ;-) All of the MySQL string functions are documented here: http://dev.mysql.c

Re: Substring functions in mySQL

2004-09-08 Thread Wesley Furgiuele
Assuming there are no parts of a name that include more than one word (e.g., "Mary Jo" being someone's first name), an easy way would be to use SUBSTRING_INDEX. First Name = SUBSTRING_INDEX( namefield, ' ', 1 ); Middle Name = SUBSTRING_INDEX( SUBSTRING_INDEX( namefield, ' ', 2 ), ' ', -1 ); Last N

Substring functions in mySQL

2004-09-08 Thread wally . randall
How can I extract a middle segment of text in mySQL. For example a column contains this string: 'William Walker Jones'. I need to split this into the first, middle, and last names. I can easily extract the first and last names but how do I extract the Middle name?

Re: extracting substring from text blob during query

2004-07-26 Thread Egor Egorov
Redmond Militante <[EMAIL PROTECTED]> wrote: > i have a large text blog that i want to extract strings out of.=20 > the large text blob See http://dev.mysql.com/doc/mysql/en/String_functions.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is spo

extracting substring from text blob during query

2004-07-21 Thread Redmond Militante
hi i have a large text blog that i want to extract strings out of. the large text blob looks like "Name: john doe Date: 060604 Subject: this is subject Text: "; i want to just extract 'john doe' '060604' and 'this is subject' from the text blob can i do this w mysql queries, or do i have to us

Re: blob and substring

2004-07-21 Thread Martin Gainty
http://www.javalobby.org/kb/entry!default.jspa;jsessionid=43D42C7656C249E645485AF43737A12A?categoryID=48&entryID=79&fromSearchPage=true HTH, Martin Gainty From: gerald_clark <[EMAIL PROTECTED]> To: jonathan dumaresq <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: blo

Re: blob and substring

2004-07-21 Thread gerald_clark
nswer. jonathan dumaresq wrote: hi all, I try to port some of the mysql api to a microcontroller and now i wonder if i miss something. I try to retreive a blob (256K) in chuck of 1024 bytes. I use the keywork substring with index 1 and size 1024 and the sql server only return 252 bytes instead of 10

blob and substring

2004-07-21 Thread jonathan dumaresq
hi all, I try to port some of the mysql api to a microcontroller and now i wonder if i miss something. I try to retreive a blob (256K) in chuck of 1024 bytes. I use the keywork substring with index 1 and size 1024 and the sql server only return 252 bytes instead of 1024. I wonder if i can use

Re: BLOB, SUBSTRING and 65536 characters limit

2004-03-12 Thread Tomas Zvala
ents of BLOB to my php script. I found out that I'm limited by max_packet_size (which i can't change because of my ISP) and i tried to work around it by using SELECT substring(column,x,1024) where x is number increasing in steps of 1024. But once x reaches 65536 i get empty result. Wha

Re: BLOB, SUBSTRING and 65536 characters limit

2004-03-11 Thread colbey
ax_packet_size (which i can't > change because of my ISP) and i tried to work around it by using SELECT > substring(column,x,1024) where x is number increasing in steps of 1024. > But once x reaches 65536 i get empty result. > What am I doing wrong or how can I work around this? > &

BLOB, SUBSTRING and 65536 characters limit

2004-03-11 Thread Tomas Zvala
Hello, I run into a problem where I need to get contents of BLOB to my php script. I found out that I'm limited by max_packet_size (which i can't change because of my ISP) and i tried to work around it by using SELECT substring(column,x,1024) where x is number increasing in steps of

SUBSTRING on a LONGBLOB

2004-01-29 Thread David Perron
Im trying to retreive the data from a LONGBLOB column but I have been unable to convert the binary data back to character data. Is there something Im not doing right with the query below? SELECT changehistory.timestamp, SUBSTRING(changedata.changes,1,1000) FROM changehistory, JOIN changedata ON

sorting using substring

2003-11-12 Thread Anthony
I am trying to write a query that will sort results using one or two substrings in item number. So for example I have item numbers that start with SE, TS, N0, W00, etc. So let say I want results sorted in the following order TS, SE, N0, W0 I have tried the followi

RE: Update query with substring

2003-06-02 Thread jbonnett
in the MySQL manual. John Bonnett -Original Message- From: Davy Obdam [mailto:[EMAIL PROTECTED] Sent: Friday, 30 May 2003 6:57 PM To: MySQL; MySQL-WIN Subject: Update query with substring Hello people, I am trying to run this query: UPDATE table1, table2 SET table1.periode = table.per

Re: Update query with substring

2003-06-02 Thread Paul DuBois
At 11:26 +0200 5/30/03, Davy Obdam wrote: Hello people, I am trying to run this query: UPDATE table1, table2 SET table1.periode = table.periode WHERE table1.id = 3 AND SUBSTRING_INDEX( table1.name, '.', - 1 ) = table2.name But i keep getting the same error message You have an error in your SQ

Re: Update query with substring

2003-05-31 Thread Victoria Reznichenko
Davy Obdam <[EMAIL PROTECTED]> wrote: > I am trying to run this query: > > UPDATE table1, table2 SET table1.periode = table.periode WHERE table1.id > = 3 AND SUBSTRING_INDEX( table1.name, '.', - 1 ) = table2.name > > But i keep getting the same error message > > You have an error in your SQL sy

Update query with substring

2003-05-30 Thread Davy Obdam
Hello people, I am trying to run this query: UPDATE table1, table2 SET table1.periode = table.periode WHERE table1.id = 3 AND SUBSTRING_INDEX( table1.name, '.', - 1 ) = table2.name But i keep getting the same error message You have an error in your SQL syntax near ' table2 SET table1.periode =

Re: mid vs substring

2002-12-28 Thread Paul DuBois
At 9:44 +0200 12/28/02, Octavian Rasnita wrote: Which is the difference between mid and substring functions in MySQL? None. MID() is actually a synonym for SUBSTRING() in MySQL. sql, query - Before posting, please check

mid vs substring

2002-12-28 Thread Octavian Rasnita
Which is the difference between mid and substring functions in MySQL? Thank you. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php

Re[2]: use of substring()

2002-06-13 Thread Julie Meloni
NW> Ooops, reserved word! Works great ;-) NW> Any way to add something to it like "" or should I do that in my NW> php? concat() is your friend! - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec

Re[2]: use of substring()

2002-06-13 Thread Julie Meloni
>> SELECT datefield, SUBSTRING(textfield, 1, 30) as description FROM >> tablename WHERE id = 2; single quotes around textfield... - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://

Re: use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Nick Wilson declared > You have an error in your SQL syntax near 'desc FROM news ORDER BY date ' at line 1 Ooops, reserved word! Works great ;-) Any way to add something to it like "" or should I do that in my php? Many thanks g

Re: use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Julie Meloni declared > Start with position 1. > > SELECT datefield, SUBSTRING(textfield, 1, 30) as description FROM > tablename WHERE id = 2; Hi again Julie and thanks for 'cross list' help! The problem is

Re: use of substring()

2002-06-13 Thread MikeParton
should it not be: SELECT date, substring(text,1,30) as string length starts at position "1". substring, therefore, would consider the first character of the string as position 1, not 0. - Original Message - From: "Nick Wilson" <[EMAIL PROTECTED]> To

Re: use of substring()

2002-06-13 Thread Keith C. Ivey
On 14 Jun 2002, at 0:03, Nick Wilson wrote: > SELECT date, SUBSTRING(text, 0,30) as description FROM table WHERE id > = '2'; You can't assume that MySQL is like Perl, PHP, or any other language you may be used to. Note this: "For functions that operate on string pos

Re: use of substring()

2002-06-13 Thread Julie Meloni
Hi - NW> I have a table (for example) with three cols 'id' | 'date' | 'text' NW> I want to return just 'date' and the first 30 chars from 'text' NW> I've tried this sql: NW> SELECT date, SUBSTRING(text, 0,30) as descript

use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm having a spot of bother with the SUBSTRING() function, I don't think I understand it properly... I have a table (for example) with three cols 'id' | 'date' | 'text' I want to return just 'd

Re: substring replace

2002-01-24 Thread DL Neil
Hi SF, > Hi, > Please help me to use SQL (with mysql prompt) command to replace any digit > in column. > > Example: > Old value 123466 > New value 123456 > > How to replace old value at fifth digit (6) to 5? You can download the MySQL manual to use it on your own machine, or access it online.

substring replace

2002-01-23 Thread Sommai Fongnamthip
Hi, Please help me to use SQL (with mysql prompt) command to replace any digit in column. Example: Old value 123466 New value 123456 How to replace old value at fifth digit (6) to 5? Thank you, SF ---

Re: how do I search for a substring of a field? sql

2002-01-09 Thread Colin Faber
Dan, you can use LIKE RLIKE and MATCH() AGAINST() If that's what you're asking. Dan wrote: > > Anyone know how to seach for a subsctring instead of the whole field? sql > > - > Before posting, please check: >http://www.my

Re: how do I search for a substring of a field? sql

2002-01-09 Thread Dan
Anyone know how to seach for a subsctring instead of the whole field? sql - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this

Re: substring

2001-03-19 Thread William Decker
]> wrote: > Hi > I need some help with substring. How can I extract > last four digit of a > field say card_no (this field has in some instance > 10 digits and for some > value has 20 digits). > > Thanks > __ Do You

substring

2001-03-19 Thread Hammad Nasim
Hi I need some help with substring. How can I extract last four digit of a field say card_no (this field has in some instance 10 digits and for some value has 20 digits). Thanks

Re: substring and a join?

2001-03-05 Thread Bob Hall
>Hello, > >I have the following query: >"SELECT thara_plane.id,thara_plane.nam >e,thara_plane.nick,thara_plane.bodytext,thara_category.category " >."FROM thara_plane,thara_category,substring(thara_plane.bodytext,225) as >bodytext " >."

substring and a join?

2001-03-05 Thread Lauri Vain
Hello, I have the following query: "SELECT thara_plane.id,thara_plane.nam e,thara_plane.nick,thara_plane.bodytext,thara_category.category " ."FROM thara_plane,thara_category,substring(thara_plane.bodytext,225) as bodytext " ."WHERE ((thara_plane.category = thara_c

RE: [PHP-DB] substring equiv in PHP

2001-01-24 Thread Oson, Chris M.
did you try substr? http://www.php.net/manual/en/function.strstr.php -Original Message- From: Lucas Rockwell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 24, 2001 1:14 PM To: PHPDB Subject: [PHP-DB] substring equiv in PHP Hello, I am wondering what PHP's equilivent of th