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
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
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
/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-
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
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 |
+---+-
[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
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:
[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
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.
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
[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
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 '
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'
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
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
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...
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
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
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
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
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,
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
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
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?
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
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
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
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
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
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
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?
>
&
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
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
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
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
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
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
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 =
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
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
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
>> 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://
-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
-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
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
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
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
-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
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.
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
---
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
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
]> 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
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
>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 "
>."
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
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
58 matches
Mail list logo