I have a table with four columns, the first three of which are combined
into a unique key:
create table Test {
cid int(9) NOT NULL default '0',
sid int(9) NOT NULL default '0',
uid int(9) NOT NULL default '0',
rating tinyint(1) NOT NULL default '0',
UNIQUE KEY csu1
try this:
select LEFT(names, 1) from table
Tim Johnson wrote:
Hello:
Is it possible to use mysql to select only
the first letter of a string in a column?
IOWS select names from table -
select first letter of names from table
another way of asking my questions would be,
Is it possible
Andy Ford wrote:
I thought LIMIT limited you to N number of CONCURRENT record. ie. limit
10 or limit 20
I believe Ross would like to select select 1000 records and then do a
sub select of records 1-20 and then 21-40 on this record set
LIMIT also allows you to specify a starting record, i.e.
Try this (untested) :
update table set column=LEFT(column, LENGTH(column)-1)
Andrea Broerman wrote:
I have successfully loaded data from a comma separated
file (CSV) into a table, but the last field in each
record appears to have a little square symbol at the
end of the text which I assume is
Seena Blace wrote:
Hi,
I want to create a table with composite Primary key.How to do that?
create table ipdet
(IPaddress varchar (14) not null ,
hostid varchar (20) not null primary key (ipaddress,hostid),
IP_DESC text ,
MAC text,
interface text);
Try this:
create table ipdet
Bing Du wrote:
Greetings,
I've been looking at the backup/recover related discussions in the list
archives for a while. Seems to me most people use either mysqldump or
mysqlhotcopy. We don't have a good MySQL backup scheme in place yet. Now
I have some questions based on my reading.
We use
alter table AUTO_INCREMENT=x
Scott Purcell wrote:
Hello,
I have an application in which I am using auto_increment as a kind of sequence replacement. The only problem I have is trying to get the auto_increment to start at a larger number than 0.
Is auto_increment the replacement for sequences?
Keith Bussey wrote:
...
Also, I'm running MySQL 4.0.13-standard, STRAIGHT JOIN doesnt seem to exist
for me ;p
I think it is actually STRAIGHT_JOIN...
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Does MySQL support formatted indexes such as in the statement below?
alter table DateInfo add index monthYear (DATE_FORMAT(updateDate,
'%m/%Y'))
If not, does anyone know of any plans to support this in the future?
Thanks,
Kevin
--
MySQL General Mailing List
For list archives:
Keith C. Ivey wrote:
On 1 Dec 2003 at 13:41, Kevin Carlson wrote:
Does MySQL support formatted indexes such as in the statement below?
alter table DateInfo add index monthYear (DATE_FORMAT(updateDate,
'%m/%Y'))
What sort of queries would that help you with?...
This helps with queries
Keith C. Ivey wrote:
On 1 Dec 2003 at 16:32, Kevin Carlson wrote:
select * from DateInfo where DATE_FORMAT(updateDate, '%m/%Y') =
'03/2003'
I have an index on the updateDate column but it does not seem to be
used since I am altering the value with the DATE_FORMAT function in
the where clause
Curley, Thomas wrote:
I am trying to find a solution to the following security issue with MySql DB on linux
- Someone copies the DB files to another box, starts a mysql instance, loads the DB and presto - views the 'private' data !!!
As all the other posters have mentioned, you should have
Using a backup I recreated the /var/lib/mysql directory and when I
restart mysqld I am getting the following error:
InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of a different
size 0 5238827 byes
InnoDB: than specified in the .cnf file 0 5242880
Of course, the database never starts
You can emulate this using IPTables and a FORWARD rule. If you are
unfamiliar with IPTables see http://www.iptables.com/ for documentation.
Misaochankun wrote:
Can this be done?
No, I do not mean running multiple MySQL servers.
I need to have MySQL listen on two separate ports at the same time.
I am using MySQL version 4.0.11 gamma on Linux 7.1 and have just
experienced the following problem:
INSERTed a record into a InnoDB table, then used SELECT to retrieve the
recordID (auto numbered field) from the same table using a key. The
SELECT returned the proper ID. However, when
gerald_clark wrote:
Did you commit the transaction?
Yes, the transaction was committed. I was using MyCC at the same time
the anomaly occurred, also. Could this have had anything to do with it?
Kevin Carlson wrote:
I am using MySQL version 4.0.11 gamma on Linux 7.1 and have just
You should be able to do this:
mysql backup.txt
-Original Message-
From: Hathaway, Scott L [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 8:49 AM
To: Mysql (E-mail)
Subject: database restore - please help
I deleted my database today by mistake and I have a backup from
Hi,
I have an interesting problem when updating columns of type DATETIME. It
seems that exactly one day is subtracted from the DATETIME value that I
submit in an update query. Has anyone encountered this? Any ideas?
Kevin
Of Benjamin
Pflugmann
Sent: Tuesday, May 28, 2002 6:19 PM
To: Kevin Carlson
Cc: Mysql
Subject: Re: Interesting datetime problem
Hi.
Maybe your TZ (timezone) environment variable is set to a strange
value? If not, could you provide a full example, so that we can try to
reproduce it and see whether
How do you reference a column name in another table to avoid repeating the
values?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Benjamin
Pflugmann
Sent: Tuesday, May 28, 2002 6:24 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: first mysql
20 matches
Mail list logo