backslash and Update

2005-12-30 Thread Jerry Swanson
I have 290 records in the database with backslashes. I want to remove the backslashes. Why the query below doesn't remove backslashes? update name set first_name = REPLACE(first_name,'','') where first_name like '%%';

Re: Reset root password to mysql?

2005-11-22 Thread Jerry Swanson
Database Administrator > HP Managed Services > 148 Frome Street, > Adelaide 5000 > Australia > > +61 8 8408 4273 - Work > +61 417 268 665 - Mobile > +61 8 8408 4259 - Fax > > > -Original Message- > From: Jerry Swanson [mailto:[EMAIL PROTECTED] > Sent:

Reset root password to mysql?

2005-11-22 Thread Jerry Swanson
How to reset mysql password to mysql? mysql -u root ERROR 1045 (0): Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)

How to start mysql on linux?

2005-11-22 Thread Jerry Swanson
I have sudo access to Linux box. How to start mysql 4.0.14. TH

Re: SSH tunnel for Mysql

2005-11-21 Thread Jerry Swanson
Both Linux computers. On 11/21/05, Gleb Paharenko <[EMAIL PROTECTED]> wrote: > > Hello. > > > > You have not specified what operating system you're using. MySQL manual > > has some notes for Windows: > > http://dev.mysql.com/doc/refman/5.0/en/windows

SSH tunnel for Mysql

2005-11-20 Thread Jerry Swanson
How to create ssh tunnel for Mysql? TH

Re: How to write this query?

2005-11-10 Thread Jerry Swanson
ere a.order_id = b.order_id > and b.item_id=c.item_id > and c.item_status_id = d.item_status_id > where d.status = 'completed' > > It isnĀ“t "tunned" but I think that it works for that you want > > > -Mensaje original- > De: Jerry Swanson [mailto:[

How to write this query?

2005-11-10 Thread Jerry Swanson
How to write the query? table1: order (order can have more than 1 item) table2: item (has order_id). table3: item_status (has item_status_id and item_id) table4: status (has item_status_id). Status can be 'complete', 'pending'. I need to get all orders that have ONLY completed items. Examples: if

Re: Delete all but the newest 100 records?

2005-11-06 Thread Jerry Swanson
If you have auto_incremnt id in the table you can do the following: delete from table a where id > start_id and id =< end_id Or you can delete by timestamp. delete from table a where date between 'start_date' and 'end_date'. On 11/6/05, Brian Dunning <[EMAIL PROTECTED]> wrote: > > I'd like to d

Differnce between fields of int type

2005-11-02 Thread Jerry Swanson
What is the difference between these two fields? Both fields hold number 5, but for some query marked_id field gives result. marked_id | int(11) | | | 0 | id | int(11) | YES | | NULL | Where you can see difference between these fields? TH

float comparison?

2005-10-29 Thread Jerry Swanson
Why when I do select from database and try to compare float field with float number, I have no results amount --- type float select * from price where amount = 3.45 // doesn't work select * from price where amount = '3.45' //doesn't work select * from price where amoun like '3.45' //work My que

float size?

2005-10-01 Thread Jerry Swanson
I have field in database type "float". When I insert number like 12345.27 , number is inserted 12345.3 Why it happened?

Group by Month

2005-07-20 Thread Jerry Swanson
I have query that pulls data between to dates. How to group the data by month? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

LIke

2005-06-28 Thread Jerry Swanson
How to make this work? field like '%DATA_FORMAT(now(), '%m%d%y') %' -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Install Mysql 4 on Fedora Core 2

2005-06-13 Thread Jerry Swanson
I want to install MySQL 4 on Fedora Core 2. Questions: #1. Do I need to uninstall MySQL 3 from the server first? #2. Where I can get source for MySQL 4? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED

View

2005-06-02 Thread Jerry Swanson
Does Mysql 4 supports "views"? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

mysql: varchar and case sensitive

2005-06-02 Thread Jerry Swanson
Column type is username varchar(100). When I do select from database: "select * from user where username='John'"; //returns one row "select * from user where username='john'"; //returns one row The records in the database has username 'John'. Why it isn't case sensitive? 'John"

Re: varchar(10) to decimal

2005-05-18 Thread Jerry Swanson
decimal(6,2) On 5/18/05, Philippe Poelvoorde <[EMAIL PROTECTED]> wrote: > Jerry Swanson wrote: > > > I need to change format from varchar(10) to decimal. > > When I alter the table the data is trimmed. > > > > What I'm doing wrrong? > > > >

varchar(10) to decimal

2005-05-17 Thread Jerry Swanson
I need to change format from varchar(10) to decimal. When I alter the table the data is trimmed. What I'm doing wrrong? TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: write query question

2005-05-11 Thread Jerry Swanson
query runs for 5 min... kill query id. On 12 May 2005 00:29:56 +0200, Harald Fuchs <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Eric Jensen <[EMAIL PROTECTED]> writes: > > > So you want 5 contacts for every user? Try this: > > SELECT COUNT(c.id) AS count, u.username, u.firs

Re: write query question

2005-05-11 Thread Jerry Swanson
I need 5 records per user. On 5/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > try this, > > select username, first_name,last_name, name as contact > from user,contact > where user.id=contact.user_id > order by username; > > Mathias > >

write query question

2005-05-11 Thread Jerry Swanson
How to select 5 records(including username, first_name, last_name, contact) for each user in the database? table user( id, username, first_name, last_name ) contact( id id_user //id from user table name ) -- MySQL General Mailing List For

REPLACE function

2005-04-28 Thread Jerry Swanson
I have field varchar(20) that stores phone numbers. Phone number can be in different format. So I need only digits from the field. How I can do such replacement? TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTE

update random date

2005-04-03 Thread Jerry Swanson
How to update randomly field date of datetime? I need to update randomly on 300 records Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Query question

2005-03-29 Thread Jerry Swanson
I want to get everything from user than if record exist in admin so user has admin(administrator) in table user with user.id = admin.admin_id, so I need to get 'admin' first_name and last_name If there is no record in table admin with adin.user_id = user.id , than I need at least all records from

Fedora Core 2: upgrade mysql 3 to mysql 4

2005-02-27 Thread Jerry Swanson
I want to upgrade mysql 3 to mysql 4. Operating System is Fedore Core 2. Is there any package dependency? How to remove mysql3 and install mysql 4? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: how to write this query?

2005-02-21 Thread Jerry Swanson
t, 19 Feb 2005 14:01:05 +, Jerry Swanson <[EMAIL PROTECTED]> wrote: > > I have two dates (start_date, end_date). Datediff() function returns > > difference in days. > > I need the difference but not including Satuday and Sunday. > > > > Any ideas? > >

how to write this query?

2005-02-19 Thread Jerry Swanson
I have two dates (start_date, end_date). Datediff() function returns difference in days. I need the difference but not including Satuday and Sunday. Any ideas? TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTE

UNIX_TIMESTAMP function

2005-02-17 Thread Jerry Swanson
How to select datetime using UNIX_TIMESTAMP excluding Saturday and Sunday? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Daily Incremental Backups on Mysql

2005-02-10 Thread Jerry Swanson
Does binary logs are avaialbe in Mysql 4 or only in Mysql 5? Thanks On Thu, 10 Feb 2005 10:28:56 +1100, Daniel Kasak <[EMAIL PROTECTED]> wrote: > Jerry Swanson wrote: > > >Is it possible to do "daily incremental backups" on mysql? > > > > > >Thank

Daily Incremental Backups on Mysql

2005-02-09 Thread Jerry Swanson
Is it possible to do "daily incremental backups" on mysql? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

mysql store queries?

2005-01-21 Thread Jerry Swanson
Does mysql stores queries? If so where? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Elegant way: select last record from table

2005-01-21 Thread Jerry Swanson
I'm interesting to know what is the best way to select last inserted record. This can do it "ORDER BY id desc limit 5" .. but .. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

subquery, returns more than one filed?

2005-01-13 Thread Jerry Swanson
Can subquery return more than one column in Mysql 4.1.7? SELECT (select user.last_name, user.first_name from actor where user.id=6) as last_name, first_name (select count(*) from account where account.status = 'progress') as progress_count, ERROR 1241 (21000): Operand should contain 1 column(s

Re: select & count

2005-01-13 Thread Jerry Swanson
read " IF(status='xxx',1,0)" instead > of "IF(concat() LIKE ...,1,0) ". > > Shawn Green > Database Administrator > Unimin Corporation - Spruce Pine > > Jerry Swanson <[EMAIL PROTECTED]> wrote on 01/13/2005 07:56:18 AM: > > > > Wha

Re: select & count

2005-01-13 Thread Jerry Swanson
What query suppose to be faster? Jan or Dave? Jan Solution: SELECT date, SUM(IF(CONCAT(status,id) LIKE 'received%',1,0)) as received, SUM(IF(CONCAT(status,id) LIKE 'send%',1,0)) as send, SUM(IF(CONCAT(status,id) LIKE 'cancelled%',1,0)) as cancelled FROM account GROUP BY date; On Wed, 12 Jan 2005

Re: select & count

2005-01-13 Thread Jerry Swanson
This is what I was looking for. Why the query is call cross-tab? TH On Thu, 13 Jan 2005 02:09:45 +, Ian Sales <[EMAIL PROTECTED]> wrote: > Jerry Swanson wrote: > > >| Field| Type > > | Null

select & count

2005-01-12 Thread Jerry Swanson
| Field| Type | Null | Key | Default | Extra | +--+--+--+-+-++ | id | int(10)

Mysql upgrade problem 3.23 to 4.1

2004-12-21 Thread Jerry Swanson
I upgraded mysql mysql-3.23.58-1 to mysql4.1 In mysql-3.23 ( I have this field) password | varbinary(45) | YES | | NULL | I inserted data into this field as password('pass'). I have php script that checks if login valid. mysql-3.23 and mysql-4.1 have identical

String function

2004-11-23 Thread Jerry Swanson
I need to make query that adds numbers. The fields are varchar format so I have some value 12121 and some values 121212,121212. I think I need string replace function that replace comma. What function can do this? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To u

How many rows?

2004-11-13 Thread Jerry Swanson
This is my query select id, status from sale where user_id = 1 GROUP BY id; I need to know how many rows or how many entries this query returns. I tried to use "count" and "sum". But the result is wrong. I want to be able to make select and know how many rows this query returns. Now, I use mysq

MySQL logs and restore data

2004-11-08 Thread Jerry Swanson
I deleted some data in mysql. Is it possible to restore the data. Maybe using MYSQL logs? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

MySQL logs and restore data

2004-11-08 Thread Jerry Swanson
I deleted some data in mysql. Is it possible to restore the data. Maybe using MYSQL logs? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

ORDER by date: reverse order

2004-11-05 Thread Jerry Swanson
I want to sort by date but the last date appears first. How to write such query? TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Redirect output to the file

2004-11-04 Thread Jerry Swanson
I want to redirect output of the query to the file in tab delimited format. Can this be done? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

MySQL Control Center and Linux box connection

2004-10-31 Thread Jerry Swanson
I have Linux box running Red Hat and 3.23. I install MySQL Contorl Center and trying connect to the mysql on Linux box. When I try to connect I receive the error message. ERROR: HOST 'ip address' is not allowed to connect to this MySQL server. What I'm doing wrong here? TH -- MySQL General Ma

Re: mysql 3.23 store large data

2004-10-29 Thread Jerry Swanson
How many characters can Longblob hold? What is the size of longblob? Why I don't need to specify the size (i.e varchar(200) )? On Wed, 27 Oct 2004 20:09:37 +0300, Gleb Paharenko <[EMAIL PROTECTED]> wrote: > Hi. > > Use LONGBLOB. > > > > > Jerr

mysql 3.23 store large data

2004-10-27 Thread Jerry Swanson
What type I should use in MySQL 3.23.58 to store large data file? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

date type & select

2004-10-26 Thread Jerry Swanson
I have comlumn in mysql type datetime. I need to get the date in DATE format. select DATE(reg_date) as test from a1; It gives me an error. How to select date in different date format? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.

Modify type

2004-10-14 Thread Jerry Swanson
I have field date type of "datetime". I need to modify to "timestamp". If I alter the table and mofiy the field will this crash the data in the field. TH -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Delete data from more than one table

2004-10-14 Thread Jerry Swanson
I can delete data for one table with no problem: delete from table; I need to delete data for more than one table. I tried to run this query: delete from account, survey; //But the query crashes. Any ideas how to delete data for more than one query. TH -- MySQL General Mailing List For list

password() function

2004-10-11 Thread Jerry Swanson
I create table and used password // CHAR(15) select password('123456'); ++ | password('123456') | ++ | 565491d704013245 | ++ //INT(10) +-+ | password| +-+ | 565491d70401324 | When I used char(