Re: A more general REPLACE(STR,FROM_STR,TO_STR) function

2005-06-29 Thread SGreen
!! 2005/6/29, Thomas Spahni [EMAIL PROTECTED]: Hi all, sometimes life would be easier with a more general 'REPLACE' function available. That's when I find mysqlf dumping a database, editing with sed and reloading. My feature request: a string editing function similar to sed's s

Call a function from a select statement?

2005-05-31 Thread Scott Klarenbach
Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2, functionPerformAdditionalQueryFromField(t.field2) AS 'customField' FROM Table t I'd like to perform the function on every row in the result set, and store the returned value of that function in EACH

RE: Call a function from a select statement?

2005-05-31 Thread Dathan Pattishall
- From: Scott Klarenbach [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 31, 2005 10:58 AM To: My SQL Subject: Call a function from a select statement? Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2

Re: Call a function from a select statement?

2005-05-31 Thread Scott Klarenbach
10:58 AM To: My SQL Subject: Call a function from a select statement? Is this not the proper way to use a function in a select statement? SELECT t.field1, t.field2, functionPerformAdditionalQueryFromField(t.field2) AS 'customField' FROM Table t I'd like to perform

learning to understand compress function

2005-05-11 Thread Steve Buehler
I am trying to figure something out about the compress function. If I wanted to compress a field in a column/row and write it back to the table, how can I do this? Is it possible to do it in one command? I tried: update `conflicts` set `fname`=(SELECT compress(`fname`) FROM `conflicts` WHERE

Re: learning to understand compress function

2005-05-11 Thread SGreen
Steve Buehler [EMAIL PROTECTED] wrote on 05/11/2005 09:36:44 AM: I am trying to figure something out about the compress function. If I wanted to compress a field in a column/row and write it back to the table, how can I do this? Is it possible to do it in one command? I tried: update

Re: learning to understand compress function

2005-05-11 Thread Jigal van Hemert
From: Steve Buehler I am trying to figure something out about the compress function. If I wanted to compress a field in a column/row and write it back to the table, how can I do this? Is it possible to do it in one command? I tried: update `conflicts` set `fname`=(SELECT compress(`fname

Re: learning to understand compress function

2005-05-11 Thread Steve Buehler
At 08:50 AM 5/11/2005, you wrote: Steve Buehler [EMAIL PROTECTED] wrote on 05/11/2005 09:36:44 AM: I am trying to figure something out about the compress function. If I wanted to compress a field in a column/row and write it back to the table, how can I do this? Is it possible to do

ERROR 1111 (HY000): Invalid use of group function

2005-05-11 Thread shaun thornburgh
(PRACT_NUMBER, 1, 4)) 1 - AND Booking_ID = 6030 - GROUP BY PRACT_NUMBER; ERROR (HY000): Invalid use of group function mysql Can anyone tell me why this is happening? Thanks for your advice -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: ERROR 1111 (HY000): Invalid use of group function

2005-05-11 Thread Paul DuBois
' - AND CHAR_LENGTH(PRACT_NUMBER) 4 - AND COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) 1 - AND Booking_ID = 6030 - GROUP BY PRACT_NUMBER; ERROR (HY000): Invalid use of group function mysql Can anyone tell me why this is happening? Because you cannot use aggregate functions in a WHERE clause. WHERE determines

Re: ERROR 1111 (HY000): Invalid use of group function

2005-05-11 Thread Stefan Kuhn
I would guess it's because you can't use an aggregate function in where, but only in having. So use select group by PRACT_NUMBER having COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) 1. The reason is that where is applied before the count is done, whereas having after that. And you can't select

Re: ERROR 1111 (HY000): Invalid use of group function

2005-05-11 Thread Michael Stassen
' - AND CHAR_LENGTH(PRACT_NUMBER) 4 - AND COUNT(SUBSTRING(PRACT_NUMBER, 1, 4)) 1 - AND Booking_ID = 6030 - GROUP BY PRACT_NUMBER; ERROR (HY000): Invalid use of group function mysql Can anyone tell me why this is happening? Because you cannot use aggregate functions in a WHERE

mysql random function strangeness

2005-05-10 Thread Graham Anderson
I have an ORDER statement like: ORDER BY playlist.order_id ASC,RAND(playlistItems.playlist_order) I am trying to get a random result very time the query is run ... Unfortunately, this statement gives the SAME random result each time how can I get mysql to randomly jumble the playlist items for a

Re: mysql random function strangeness

2005-05-10 Thread Graham Anderson
got it to work thanks On May 10, 2005, at 7:22 PM, Graham Anderson wrote: I have an ORDER statement like: ORDER BY playlist.order_id ASC,RAND(playlistItems.playlist_order) I am trying to get a random result very time the query is run ... Unfortunately, this statement gives the SAME random

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

Re: REPLACE function

2005-04-28 Thread Chris Ramsay
If I understand your problem, MySQL allows you to use regular expressions - so you could use the REGEXP function to remove the spaces. Check out the mysql site... Chris -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

Re: REPLACE function

2005-04-28 Thread Eamon Daly
Sadly, the REGEXP function is only for string comparison, not substitution. You'll either have to handle the replacement on the client side or string together an unwieldy series of REPLACE functions, like so: SET @phone = '(123) 456-7890'; SELECT REPLACE( REPLACE( REPLACE( REPLACE(@phone

Call to undefined function: mysql_connect()

2005-04-07 Thread sudheshna aaa
Team, I am trying to make apache-php and mysql work on Linux Redhat. I have the following versions installed that came with Redhat Linux: apache 2.0.46 mysql 3.23.58 php 4.3.2 I am getting the following error when I tried to connect to MySQL thru PHP. Fatal error: Call to undefined function

Re: Call to undefined function: mysql_connect()

2005-04-07 Thread Gleb Paharenko
with Redhat Linux: apache 2.0.46 mysql 3.23.58 php 4.3.2 I am getting the following error when I tried to connect to MySQL thru PHP. Fatal error: Call to undefined function: mysql_connect() in /var/www/html/includes/database.mysql.inc on line 31 Can anybody help? Your help

Can a Function return multiple values?

2005-04-04 Thread Anchan, Dinesh
I am trying to return multiple values from a Function, not sure if it is allowed: delimiter | create function cf_test() returns integer, varchar(255)/* tried with semicolon after varchar(255) */ begin declare p_col2 smallint; declare p_col3 varchar(255); select col2, col3

again on encryption function, with bug 7846 question

2005-03-22 Thread symbulos partners
Dear friends, thanks for the link to the dev manual page on encryption function. Which encryption is more secure (strongest) AES DES SHA ? I would have said AES, but after reading the manual chapters on DES, SHA I am not s(ec)ure any more. By the way, I did not understand if the bug http

RE: again on encryption function, with bug 7846 question

2005-03-22 Thread Tom Crimmins
On Tuesday, March 22, 2005 07:15, symbulos partners wrote: Dear friends, thanks for the link to the dev manual page on encryption function. Which encryption is more secure (strongest) AES DES SHA ? Are you using this for password storage or encrypting actual data? If you are using

Re: QUOTE() function, what happens here?

2005-03-17 Thread Thomas Spahni
Hi everyone, I'm following up on my own question. There appears to be a bug in the way how QUOTE() interacts with the mysql client. Using --raw mode can apparently solve the problem reported in my original post: shell mysql --raw -N -B -e SELECT QUOTE(sometext) FROM foo; test 'Pitt\'s Place'

Re: QUOTE() function, what happens here?

2005-03-17 Thread SGreen
to be leaving out the 3rd \. http://dev.mysql.com/doc/mysql/en/string-syntax.html Thomas, I think you should file a bug report on this. That way they FIX the QUOTE() function. No middle-ground needed. Shawn Green Database Administrator Unimin Corporation - Spruce Pine [EMAIL PROTECTED] wrote

use of 'if()' function in 'order by' clause...

2005-03-17 Thread Peter Smith
employee - order by if(fname is not null, 1, 2); Works. Well, it executes, but it does not order by the first or second column, just the natural order of the table it seems. One added feature is that our 'order by if' function looks like this: - order by if(fname is null, 0, 1); Doing

QUOTE() function, what happens here?

2005-03-15 Thread Thomas Spahni
Dear list, I don't understand what happens here: shell mysql -N -e SHOW VARIABLES LIKE 'version'; test +-++ | version | 4.0.14-log | +-++ shell mysql -e CREATE TABLE foo (sometext VARCHAR(255)); test shell mysql -e INSERT INTO foo VALUES('Pitt\\'s

Problem with Limit function in MySQL 4.1.9

2005-02-24 Thread Cecil Brand
Hi, I have the following problem, I'm converting from version 3.23.53 to 4.1.9 The following query was used SELECT * FROM news WHERE languages_id = 'english' AND expiry_ts = CURDATE() AND FCode = '999' AND DCode = 'Z999' ORDER by id DESC LIMIT 0, 3 it work perfectly on the version 3.23.53 (the

Re: What is the max length of IN() function?

2005-02-17 Thread Keith Ivey
Donny Simonton wrote: In our case we were using words, and phrases, so we would have something like: IN ('a', 'apple', 'apple car', 'car', 'c') etc... We found that once it hits about 200 or so entries the query went from 0.00 seconds to about 2-3 seconds. Sometimes much more. I would guess that

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: UNIX_TIMESTAMP function

2005-02-17 Thread Michael Dykman
SELECT unix_timestamp(mydatetime), ... from mytable where DAYNAME(mydatetime) is not in('Saturday','Sunday'); On Thu, 2005-02-17 at 16:34, Jerry Swanson wrote: How to select datetime using UNIX_TIMESTAMP excluding Saturday and Sunday? -- - michael dykman - [EMAIL PROTECTED] -- MySQL

What is the max length of IN() function?

2005-02-16 Thread Daevid Vincent
I tried to find this function on the dev.mysql.com site, but good luck finding in... ;-) Can someone tell me what the maximum length is for this function? SELECT * FROM foo WHERE bar IN(1,2,3,4,. N); How many entries can there be in between 1 and N ? Hundreds? Thousands? Millions

RE: What is the max length of IN() function?

2005-02-16 Thread Tom Crimmins
-Original Message- From: Daevid Vincent Sent: Wednesday, February 16, 2005 20:59 To: mysql@lists.mysql.com Subject: What is the max length of IN() function? I tried to find this function on the dev.mysql.com site, but good luck finding in... ;-) Can someone tell me what

RE: What is the max length of IN() function?

2005-02-16 Thread Donny Simonton
To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: RE: What is the max length of IN() function? -Original Message- From: Daevid Vincent Sent: Wednesday, February 16, 2005 20:59 To: mysql@lists.mysql.com Subject: What is the max length of IN() function? I tried to find

Re: Undo function?

2005-01-21 Thread Duan Pavlica
PM Subject: Undo function? Hi, I get very nervous when I log onto my database via SSH and type in queries manually. Take the following query for example: Delete FROM Users WHERE User_ID = 5; If I hit return before I start typing WHERE then things would be disastorous! Is there any type of undo

Undo function?

2005-01-20 Thread shaun thornburgh
Hi, I get very nervous when I log onto my database via SSH and type in queries manually. Take the following query for example: Delete FROM Users WHERE User_ID = 5; If I hit return before I start typing WHERE then things would be disastorous! Is there any type of undo function with MySQL

Re: Undo function?

2005-01-20 Thread Martijn Tonies
Hello, I get very nervous when I log onto my database via SSH and type in queries manually. Take the following query for example: Delete FROM Users WHERE User_ID = 5; If I hit return before I start typing WHERE then things would be disastorous! Is there any type of undo function with MySQL

RE: Undo function?

2005-01-20 Thread Jay Blanchard
[snip] I get very nervous when I log onto my database via SSH and type in queries manually. Take the following query for example: Delete FROM Users WHERE User_ID = 5; If I hit return before I start typing WHERE then things would be disastorous! Is there any type of undo function with MySQL

Re: Undo function?

2005-01-20 Thread harmen-mysql
would be disastorous! Is there any type of undo function with MySQL? [/snip] You'll want to read this http://dev.mysql.com/doc/mysql/en/COMMIT.html And try: $ mysql --i-am-a-dummy that makes it refuse deletes without 'where' Good luck, Harmen

RE: Undo function?

2005-01-20 Thread Artem Koltsov
Subject: Undo function? Hi, I get very nervous when I log onto my database via SSH and type in queries manually. Take the following query for example: Delete FROM Users WHERE User_ID = 5; If I hit return before I start typing WHERE then things would be disastorous! Is there any

RE: Undo function?

2005-01-20 Thread Andy Eastham
Backups are good too :-) Andy -Original Message- From: Artem Koltsov [mailto:[EMAIL PROTECTED] Sent: 20 January 2005 15:06 To: mysql@lists.mysql.com Subject: RE: Undo function? Hello, If you define table type as InnoDB, you can use transactions (see the link below). You

Re: Undo function?

2005-01-20 Thread John Pignata
[mailto:[EMAIL PROTECTED] Sent: 20 January 2005 15:06 To: mysql@lists.mysql.com Subject: RE: Undo function? Hello, If you define table type as InnoDB, you can use transactions (see the link below). You will need set AUTOCOMMIT=0, and after you can issue COMMIT or ROLLBACK at the end

Re: [Fwd: Re: MUTIPLY function?]

2004-12-23 Thread Konrad Kieling
That particular formula cannot handle ANY non-positive number because the LOG() function is undefined for values less than or equal to zero. I just reviewed the archives and realized that this point has never been discussed before (I thought it had). Good catch. well, the slow and dirty

Re: [Fwd: Re: MUTIPLY function?]

2004-12-22 Thread SGreen
Alex, you are correct. That particular formula cannot handle ANY non-positive number because the LOG() function is undefined for values less than or equal to zero. I just reviewed the archives and realized that this point has never been discussed before (I thought it had). Good catch

Re: [Fwd: Re: MUTIPLY function?]

2004-12-22 Thread Alex croes
= the product. What if the field contains the value of 0, than it doesn't works. 3*0 = 0, but it returns 1. Alex, you are correct. That particular formula cannot handle ANY non-positive number because the LOG() function is undefined for values less than or equal to zero. I just reviewed the archives

[Fwd: Re: MUTIPLY function?]

2004-12-21 Thread Alex croes
Michael Stassen wrote: No, but Harold Fuchs gave the following solution to Shawn Green in an earlier thread on this topic http://lists.mysql.com/mysql/166184. EXP(SUM(LOG(COALESCE(*the field you want to multiply*,1))) which works because LOG(xy) = LOG(x) + LOG(y), and EXP(LOG(x)) = x. Hence,

Re: queries and mail function

2004-12-18 Thread Sasha Pachev
John Visicaro wrote: Hi, This is my first post so I hope I've done it right. I am having trouble querying an email address from MySQL and then placing that field into the PHP mail function. It doesn't work. Here's my code: $query_string = SELECT Email FROM instructors WHERE HSA_NO = '$insthsaid

Quick Question: Year() function result?

2004-12-17 Thread Rhino
Does anyone know what Column Type the result of the Year() function is? In other words, if I execute: select Year(Hiredate) as mycolname from mytable; is the result a smallint? a char()? a varchar()? Unfortunately, the manual doesn't say and I can't think of a quick way to figure it out

Re: Quick Question: Year() function result?

2004-12-17 Thread mos
At 03:24 PM 12/17/2004, you wrote: Does anyone know what Column Type the result of the Year() function is? In other words, if I execute: select Year(Hiredate) as mycolname from mytable; is the result a smallint? a char()? a varchar()? Unfortunately, the manual doesn't say and I can't think

Re: Quick Question: Year() function result?

2004-12-17 Thread Roger Baklund
Rhino wrote: Does anyone know what Column Type the result of the Year() function is? In other words, if I execute: select Year(Hiredate) as mycolname from mytable; is the result a smallint? a char()? a varchar()? Unfortunately, the manual doesn't say and I can't think of a quick way to figure

queries and mail function

2004-12-17 Thread John Visicaro
Hi, This is my first post so I hope I've done it right. I am having trouble querying an email address from MySQL and then placing that field into the PHP mail function. It doesn't work. Here's my code: $query_string = SELECT Email FROM instructors WHERE HSA_NO = '$insthsaid'; $result

Function

2004-12-16 Thread Ronan Lucio
Hello, Is there a way to create my own function on MySQL (4.0.18)? We have a site where a product can have it´s price in differents currencies, so, I need to make a query that returns the correct product´s price. Thanks, Ronan -- MySQL General Mailing List For list archives: http

Re: Function

2004-12-16 Thread Rhino
- Original Message - From: Ronan Lucio [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 7:36 AM Subject: Function Hello, Is there a way to create my own function on MySQL (4.0.18)? We have a site where a product can have it´s price in differents

sum() Function and NULL values

2004-12-16 Thread Gustafson, Tim
Is there any way to make sum() return 0 instead of NULL when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat NULL as 0 when dealing with mathematical functions? Tim Gustafson MEI Technology Consulting, Inc [EMAIL PROTECTED] (516) 379-0001

Re: sum() Function and NULL values

2004-12-16 Thread Johan Höök
Hi Tim, I guess you can add something like this to your statement: SELECT COALESCE( SUM(column) , 0 ) FROM ... /Johan Gustafson, Tim wrote: Is there any way to make sum() return 0 instead of NULL when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL

Re: sum() Function and NULL values

2004-12-16 Thread beacker
Is there any way to make sum() return 0 instead of NULL when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat NULL as 0 when dealing with mathematical functions? You can use ifnull select sum(ifnull(points,0)) from abc; Brad Eacker

RE: sum() Function and NULL values

2004-12-16 Thread SGreen
Jay Blanchard [EMAIL PROTECTED] wrote on 12/16/2004 01:00:00 PM: [snip] Is there any way to make sum() return 0 instead of NULL when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat NULL as 0 when dealing with mathematical functions?

RE: sum() Function and NULL values

2004-12-16 Thread Jay Blanchard
[snip] Is there any way to make sum() return 0 instead of NULL when one or more of the rows being sum()'d is null? Phrased another way, is there a way to make mySQL treat NULL as 0 when dealing with mathematical functions? [/snip] Use an IF... SELECT SUM(IF(myColumn IS NULL, 0, myColumn)) AS

RE: sum() Function and NULL values

2004-12-16 Thread Gustafson, Tim
Thanks for all your responses. I went with the coalesce way - it works like a charm. Thanks again! Tim Gustafson MEI Technology Consulting, Inc [EMAIL PROTECTED] (516) 379-0001 Office (516) 480-1870 Mobile/Emergencies (516) 908-4185 Fax http://www.meitech.com/ -- MySQL General Mailing List

MUTIPLY function?

2004-12-07 Thread Alex croes
Is there in the MySQL query language a function just like the SUM() but instead of adding multiplying? AC -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: MUTIPLY function?

2004-12-07 Thread Michael Stassen
of the product, so exp of the sum of the logs = exp of the log of the product = the product. Michael Alex croes wrote: Is there in the MySQL query language a function just like the SUM() but instead of adding multiplying? AC -- MySQL General Mailing List For list archives: http://lists.mysql.com

Different password() function ?

2004-12-03 Thread Ady Wicaksono
I just upgrade my MySQL from 4.0.20 to 4.1.7, however i found new things here, password() function in 4.0.20 - password(xxx) result in 5336eb751494bdb1 in 4.1.7 - password(xxx) result in *3E5287812B7D1F947439AC45E739353 how to get backward compatibility for this function ? since i use password

Re: Different password() function ?

2004-12-03 Thread Ady Wicaksono
PROTECTED] [EMAIL PROTECTED] CC: Subject: Different password() function ? Sent: Fri, 03 Dec 2004 10:01:06 GMT Received: Fri, 03 Dec 2004 09:51:54 GMT Read: Fri, 03 Dec 2004 09:57:47 GMT I just upgrade my MySQL from 4.0.20 to 4.1.7, however i found new things here, password() function in 4.0.20

RE: Different password() function ?

2004-12-03 Thread SciBit MySQL Team
/mycon http://www.scibit.com/products/mysqlcomponents http://www.scibit.com/products/mysqlx http://www.scibit.com/products/mascon -Original Message- From: Ady Wicaksono [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] CC: Subject: Different password() function ? Sent: Fri

mysql 4.1.7 make error manager.c: In function `mysql_manager_connect':

2004-12-03 Thread Ryan H. Madison
/mysql/data\ -DSHAREDIR=\/usr/local/mysql-4.1.7/share/mysql\ -DUNDEF_THREADS_HACK -DDONT_USE_RAID -I. -I. -I.. -I../include -O3 -DDBUG_OFF -MT manager.lo -MD -MP -MF .deps/manager.Tpo -c manager.c -fPIC -DPIC -o .libs/manager.o manager.c: In function `mysql_manager_connect': manager.c:136: warning

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

Re: String function

2004-11-23 Thread Paul DuBois
At 14:12 -0500 11/23/04, Jerry Swanson wrote: 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? It's called REPLACE(). http

ENCRYPT() function

2004-10-21 Thread elimachi
Dear list: I have a short database with id,username and password for authenticate my users with freeradius. The passwords are encrypted through ENCRYPT() function. I´d like to know why ENCRYPT() function doesn´t give the same encrypted string for a clear text string?. e.g. In the first time

Re: ENCRYPT() function

2004-10-21 Thread Paul DuBois
At 15:41 -0400 10/21/04, [EMAIL PROTECTED] wrote: Dear list: I have a short database with id,username and password for authenticate my users with freeradius. The passwords are encrypted through ENCRYPT() function. I´d like to know why ENCRYPT() function doesn´t give the same encrypted string

Re: ENCRYPT() function

2004-10-21 Thread elimachi
Thank you very much Paul. EDWIN LIMACHI N. Phone. 591-2-2123978 Movil: 591-715-29967 Fax: 591-2-2123975 Paul DuBois [EMAIL PROTECTED] 21/10/2004 15:56 Para [EMAIL PROTECTED], [EMAIL PROTECTED] cc Asunto Re: ENCRYPT() function At 15:41 -0400 10/21/04, [EMAIL PROTECTED

Re: password() function

2004-10-11 Thread Paul DuBois
| +-+ | 565491d70401324 | When I used char(15) the data was not complete. What data type I should use for password function? Actually, you should use a different function than PASSWORD(), which should be used only in connection with account information in the grant tables in the mysql database. SHA

Re: PRODUCT() function - calculating the product of grouped numeric values

2004-08-31 Thread Johan Hook
Hi, you might take a look at this thread: http://lists.mysql.com/mysql/166184 /Johan Hi, I'm searching for a function that enables me to calculate the product of a group of values, like SUM() does. MySQL server version is at least 4.0.14. For example, a query like SELECT id, PRODUCT(value

Re: PRODUCT() function - calculating the product of grouped numeric values

2004-08-31 Thread Thomas Schager
Hi, you might take a look at this thread: http://lists.mysql.com/mysql/166184 Thanks a lot - perfect. I was searching for a mathematical function too, but I didn't cope it... this version works great! Best regards, Thomas -- MySQL General Mailing List For list archives: http

Re: AVG Function

2004-08-27 Thread SGreen
Hi Craig, Sorry this is such a slow response but I have been swamped and I didn't see where anyone else has responded yet. First, we need to calculate the average ID per user but round the average to the nearest whole number. CREATE TEMPORARY TABLE tmpResults SELECT cast((AVG(id)+ .5) as

Re: AVG Function

2004-08-27 Thread Michael Stassen
Craig Hoffman wrote: Mark, Yes its close and thank you. The problem I am having is I am able to generate the correct ranking.id for that particular user but I can't seem to make it equal the ranking.rating. ID ranking.rating 9 = 5.6 (example) Here's my query: SELECT routes.user_id,

Re: AVG Function

2004-08-25 Thread Craig Hoffman
Mark, Yes its close and thank you. The problem I am having is I am able to generate the correct ranking.id for that particular user but I can't seem to make it equal the ranking.rating. ID ranking.rating 9 = 5.6 (example) Here's my query: SELECT routes.user_id, ranking.rating,

Using CREATE PROCEDURE/FUNCTION

2004-08-25 Thread Marti Quixal
Hi! Anybody knows how to use CREATE PROCEDURE and CREATE FUNCTION in 4.1.1-alpha-Max. I keep trying the CREATE PROCEDURE and CREATE FUNCTION examples found in the MySQL web documentation, but there's no way to make it work. It always prompts problems with syntax. Is delimiter a function

RE: Using CREATE PROCEDURE/FUNCTION

2004-08-25 Thread Boyd E. Hemphill
, 2004 8:23 AM To: [EMAIL PROTECTED] Subject: Using CREATE PROCEDURE/FUNCTION Hi! Anybody knows how to use CREATE PROCEDURE and CREATE FUNCTION in 4.1.1-alpha-Max. I keep trying the CREATE PROCEDURE and CREATE FUNCTION examples found in the MySQL web documentation, but there's no way to make

Re: Using CREATE PROCEDURE/FUNCTION

2004-08-25 Thread Terry Riley
I think you'll find that 'create procedure' and 'create function' don't appear until version 5.0 of MySQL. Which is why you get a syntax (are you sure you have the right version?) error. Regards Terry - Original Message - Hi! Anybody knows how to use CREATE PROCEDURE and CREATE

AVG Function

2004-08-24 Thread Craig Hoffman
Hey Everyone, I can you some assistance on this query. I have three tables one is called ranking and the other is called routes and finally the users table. The users table is not really important. The ranking table looks like this: id rating 1 5.0 2 5.1 3 5.2 4 5.3

Function to multiply multiple row values

2004-08-22 Thread Leonardus Setiabudi
Hi All, Can someone point me a function that return the multiplication of query result.. Hack.. It's hard for me just to explain what I nedd.. Ok, it goes like the sum() function, but instead of the summary.. It will return the multiplication Here is what I need it to do x --- 1 2 3 4

Re: Function to multiply multiple row values

2004-08-22 Thread Rhino
- Original Message - From: Leonardus Setiabudi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 22, 2004 11:45 PM Subject: Function to multiply multiple row values Hi All, Can someone point me a function that return the multiplication of query result.. Hack.. It's hard

Re: Function to multiply multiple row values

2004-08-22 Thread Leonardus Setiabudi
x --- 1 2 3 4 Select sum(x) would return 10 right.. Now I need a function .. Say fx() so that when I issued Select fx(x) ... It would return 24 which is 1x2x3x4 I assume that the function that yielded 24 was fx(4), not fx(x). In high school math, which was a *long

Re: how to add time to NOW() function

2004-08-07 Thread Michael Stassen
:58 AM To: [EMAIL PROTECTED] Subject: how to add time to NOW() function i want to add time to NOW() function, that means something like this, $addTime = 60; NOW() + $addTime; where 60 are seconds. I am not sure whether to add seconds or is there any other format I can use to add time to NOW

how to add time to NOW() function

2004-08-06 Thread Deepak Dhake
i want to add time to NOW() function, that means something like this, $addTime = 60; NOW() + $addTime; where 60 are seconds. I am not sure whether to add seconds or is there any other format I can use to add time to NOW() function? please let me know. thanks in advance. deepak -- MySQL General

Re: how to add time to NOW() function

2004-08-06 Thread SGreen
() function, that means something like this, $addTime = 60; NOW() + $addTime; where 60 are seconds. I am not sure whether to add seconds or is there any other format I can use to add time to NOW() function? please let me know. thanks in advance. deepak -- MySQL General Mailing

RE: how to add time to NOW() function

2004-08-06 Thread Amit_Wadhwa
Use DATE_ADD(NOW(),INTERVAL 1 HOUR) Or DATE_ADD(NOW(),INTERVAL 60 MINUTE) Or DATE_ADD(NOW(),INTERVAL 3600 SECOND) -Original Message- From: Deepak Dhake [mailto:[EMAIL PROTECTED] Sent: Saturday, August 07, 2004 1:58 AM To: [EMAIL PROTECTED] Subject: how to add time to NOW() function

RE: Date Conversion Function

2004-07-30 Thread christopher . l . hood
Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 12:27 PM To: Christopher L. Hood; '[EMAIL PROTECTED] ' Subject: RE: Date Conversion Function I do not know of an MM() date function in MS SQL, only mm used for the date part. What are you attempting

Date Conversion Function

2004-07-29 Thread christopher . l . hood
M$ SQL server has a function MM that will do some date conversion, is there an equivalent in MySQL ?? Chris Hood Investigator Verizon Global Security Operations Center Email: [EMAIL PROTECTED] Desk: 972.399.5900 Verizon Proprietary NOTICE - This message and any attached files may

Re: Date Conversion Function

2004-07-29 Thread Jennifer Goodie
Not being an MSSQL expert, I don't know what MM does, and since you did not specify what type of conversions you wish to perform, I can't say exactly which function would suit your needs, but here is a link to the manual page that lists all date and time functions -- http://dev.mysql.com/doc

RE: Date Conversion Function

2004-07-29 Thread Victor Pendleton
I do not know of an MM() date function in MS SQL, only mm used for the date part. What are you attempting to accomplish? -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 7/29/04 11:17 AM Subject: Date Conversion Function M$ SQL server has a function MM that will do

Re: Using function followed by order by function_name(table.field_name).....

2004-07-28 Thread SGreen
Green Database Administrator Unimin Corporation - Spruce Pine Scott Fletcher [EMAIL PROTECTED] wrote on 07/27/2004 05:29:05 PM: I'm having a little bit of a trouble with the use of the SQL function... What I have here is a webpage that show the row of data, the web user get to click

RE: Using function followed by order by function_name(table.field_name).....

2004-07-28 Thread SGreen
you wanted. Please, let's try again. Please, show me the results of just a plain ORDER BY field_name query (without the CHAR() function) and explain to me what is wrong... Yours, Shawn Green Database Administrator Unimin Corporation - Spruce Pine Scott Fletcher [EMAIL PROTECTED] wrote on 07/28

RE: Using function followed by order by function_name(table.field_name).....

2004-07-28 Thread SGreen
sorted according to the rules built into the characterset being used (see table above). So, please try to explain again why an ORDER BY fieldname (without any sort of conversion function on your field) does not work as you want it to. Thank you for your patience with me, Shawn Green Database

Fw: Using function followed by order by function_name(table.field_name).....

2004-07-28 Thread SGreen
Googling for the documents, here is a link to the MySQL manual that heads up the section on almost all of the functions in MySQL: (http://dev.mysql.com/doc/mysql/en/Functions.html). May I suggest you look at the Date_Format() function as an easier method to re-format your dates for display

Using function followed by order by function_name(table.field_name).....

2004-07-27 Thread Scott Fletcher
I'm having a little bit of a trouble with the use of the SQL function... What I have here is a webpage that show the row of data, the web user get to click on the field to sort the row by the field name. So, when I use order by char(field_name), the data doesn't turned out right in alpha-numeric

sql function for timestamp

2004-07-14 Thread J S
Hi, What SQL function do I need to convert timestamp 200406011403 into 2004-06-01 14:03 ? Thanks, JS. _ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger -- MySQL General Mailing List For list

RE: sql function for timestamp

2004-07-14 Thread Chinchilla Zúñiga, Guillermo
In MySQL you can do that with: DATE_FORMAT DATE_FORMAT (column_name,'%Y-%m-%d %H:%i') -Mensaje original- De: J S [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 14 de Julio de 2004 08:26 a.m. Para: [EMAIL PROTECTED] Asunto: sql function for timestamp Hi, What SQL function do I need

RE: sql function for timestamp

2004-07-14 Thread Eve Atley
While in PHP you can try something like this... $date_added = $row['date_added']; $date = date(M d, Y, strtotime($date_added)); echo $date; H and i do work in PHP as well, I believe, if you want to add the hour and seconds. Check out the 'date' function in PHP for info

Re: sql function for timestamp

2004-07-14 Thread Wesley Furgiuele
' ), or, as far as I can tell, you will probably be better off just using string functions. Wes On Jul 14, 2004, at 10:25 AM, J S wrote: Hi, What SQL function do I need to convert timestamp 200406011403 into 2004-06-01 14:03 ? Thanks, JS

RE: sql function for timestamp

2004-07-14 Thread J S
as well, I believe, if you want to add the hour and seconds. Check out the 'date' function in PHP for info. - Eve In MySQL you can do that with: DATE_FORMAT DATE_FORMAT (column_name,'%Y-%m-%d %H:%i') -Mensaje original- De: J S [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 14 de Julio de

<    1   2   3   4   5   6   7   8   9   10   >