Re: Converting string hex column to integer

2006-06-28 Thread Wolfram Kraus
On 28.06.2006 13:54, DuĊĦan Pavlica wrote: Hello, I have column of type char(2) containing hex numbers (e.g. 0A, FF, ...) and I cannot find correct function which could convert those hex numbers to integers so I can perform futher calculations. I experimented with HEX(), CAST(), CONVERT() but

Re: Matching problem

2006-05-09 Thread Wolfram Kraus
Barry wrote: Hello everyone! I have a slight problem matching rows. My problem is the Value in a textfield is: 87682next39857 I created that with concat. Is there a way to match one specific number out of that field? like WHERE SUPERFUNCTION(concated_field) = 87682 WHERE concated_field LIKE

Re: Matching problem

2006-05-09 Thread Wolfram Kraus
Marcus Bointon wrote: On 9 May 2006, at 14:27, Wolfram Kraus wrote: WHERE concated_field LIKE '%87682%' No, because that would also match numbers that contain that sequence like '187682next32876825'. WHERE concated_field LIKE '87682%' OR concated_field LIKE '%87682' Still poor

Re: Force a COMMIT on InnoDB tables?

2006-03-28 Thread Wolfram Kraus
patrick wrote: I'm wondering if there's any way to force updates on InnoDB tables to require an explicit COMMIT when running queries from the mysql command-line client (similar to Oracle's command line client)? set autocommit = 0 See

Re: Histogram from tables.

2006-01-13 Thread Wolfram Kraus
Mike Martin wrote: I have a large table of filenames and creation dates from which I want to produce a histogram. SELECT year(date), quarter(date), count(0) FROM pics WHERE date(date) '2000' AND date(date) ' 2005' GROUP BY year(date), quarter(date) Gets me close, but to simplify

Re: Mysql 4.0 always executes case insensitive queries

2005-12-12 Thread Wolfram Kraus
Nico Sabbi wrote: Hi, my mysql always executes case insensitive queries: SELECT username FROM workflow.user WHERE username = 'NicO' LIMIT 1; +--+ | username | +--+ | nico | +--+ 1 row in set (0.01 sec) that field is of varchar(255) type. I don't understand the

Re: Can we run linux commands from inside the msql client

2005-09-28 Thread Wolfram Kraus
Sujay Koduri wrote: hi.. I searched the documentation and googled for sometime, but didnt find anything related to this can we execute shell commands inside mysql client (like using ! in oracle), and if possible please tell me how. sujay Use \! E.g. \! ls More information :\? HTH,

Re: port option ignored by commands

2005-07-27 Thread Wolfram Kraus
[EMAIL PROTECTED] wrote: Hi, using mysql 4.0.22-standard-log. one instance on port 3307 one instance on port 3306 (each binary in its own independent directory) unix 'root' account submits following commands and connects to mysql on default 3306 port instead of awaited 3307 port :

Re: Auto SQL

2005-04-11 Thread Wolfram Kraus
Winanjaya wrote: Dear MySQL Experts, I am using MySQL 4.1, I have a database with more than 100 tables inside, is there any 3rd party tools that can help me to create a SQL statement of CREATE TABLE blah blah blah for each table in my DB . please advise Regards Winanjaya mysqldump -d

Re: Left join results - can we make it produce at most 1 row?

2005-02-17 Thread Wolfram Kraus
Joshua Beall wrote: Hi All, I have two tables in a children's program registration system, parent and child. 1 row in the parent table corresponds to 1 or more rows in the child table. Right now, when I do SELECT * FROM parent LEFT JOIN child ON parent.ID = child.parentID I get multiple rows

Re: Left join results - can we make it produce at most 1 row?

2005-02-17 Thread Wolfram Kraus
Joshua Beall wrote: Wolfram Kraus [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Use GROUP BY with GROUP_CONCAT: http://dev.mysql.com/doc/mysql/en/group-by-functions.html Thanks, I'll take a look and see if I can figure that out. I wasn't aware of the GROUP_CONCAT function

Re: RETURNING Keyword?

2005-02-09 Thread Wolfram Kraus
Justin Burger wrote: Good Afternoon, In Oracle there is a keyword called RETURNING, where I can do an insert and specify what row to return, this helps with autoincrement fields; How can I achieve this in MySQL? If you only want to know the value of the last inserted autoinc field, use

Re: simple concurrency problem - any advice ??

2005-01-11 Thread Wolfram Kraus
Heyho! Tim Wood wrote: Hi I have a number of clients connecting to a DB in order to take jobs off a queue, mark them active, then run them. In pseudo code, each client executes the following sequence of queries: a-- select test_id from tests where status=1 and priority 11 order by priority

Re: replacing field contents?

2005-01-10 Thread Wolfram Kraus
Heyho! Robin Lynn Frank wrote: I hope this question doesn't sound too dumb, but since I can't afford to screw it up... I have a table with 98,000 records. I want to globally replace the content of one field where the content is XXX diverse_text with XXX non-diverse_new_text In other

Re: sorting doesn't work correctly with UTF-8 data

2005-01-04 Thread Wolfram Kraus
Erol YILDIZ wrote: Hi, I have mysql-4.0.18 installed and entered data with UTF-8 characters. When I use a Select command, mysql doesn't sort the data correctly which starts with native Turkish letters. Is there a way to fix it? MySQL 4.0.x doesn't support UTF-8, you need MySQL 4.1.x (4.1.8 is

Re: Dates range query

2005-01-04 Thread Wolfram Kraus
Brian Menke wrote: Hi everyone, I've always had a challenge working with dates. I'm building an app that needs to query a range of dates. I'm using ASP (for the first time, I usually write in Java). Anyway my date column uses the -00-00 format, which I think is the default format? Is it?

Re: how escape special in a field - fixed ( null plus something = ? )

2004-12-13 Thread Wolfram Kraus
YW CHAN (Cai Lun e-Business) wrote: Gleb, Thanks, eventually I find that the problem is not the special. But the statement concat(field1,',',field2) as something will generate NULL if the field1 is NULL. Not sure if it's documented anywhere, or just a simple programming concept that

Re: Results question

2004-12-02 Thread Wolfram Kraus
Stuart Felenstein wrote: I have a select, from, where, query set up. There are a number of inner joins in it as well. Now what I noticed is if there are some null fields in the records, nothing will get returned. If I remove those particular joins (where the NULLS are), the record is returned.

Re: Stored Procedure?

2004-11-30 Thread Wolfram Kraus
[...] Suppose you have a table with a million records, test scores from a widely taken exam for example. You need to find the median mark - NOT the average! - so your algorithm needs to read all million records, sort them into ascending or descending sequence by the test score, then read exactly

Re: Stored Procedure?

2004-11-30 Thread Wolfram Kraus
is bad, I only said that in MySQL you can do this without a SP. Mike Wolfram Wolfram Kraus wrote: [...] Suppose you have a table with a million records, test scores from a widely taken exam for example. You need to find the median mark - NOT the average! - so your algorithm needs to read all

Re: Stored Procedure?

2004-11-30 Thread Wolfram Kraus
Heyho! [EMAIL PROTECTED] wrote: news [EMAIL PROTECTED] wrote on 11/30/2004 07:58:18 AM: Michael J. Pawlowsky wrote: Because you will be downloading 500,000 rows... And I don't really think that was the point. Who cares what the example is. Personally I was quite impressed with great

Re: Number of connections to a database

2004-11-29 Thread Wolfram Kraus
Philippe de Rochambeau wrote: Hello, is there any way to tell the number of simultaneous connections to a mysql database at a given time, using SQL or a scripting language such as php, perl, etc. ? Many thanks. Philippe show status is your friend: show status like Connections HTH, Wolfram --

Re: Redirect output to the file

2004-11-04 Thread Wolfram Kraus
Jerry Swanson wrote: I want to redirect output of the query to the file in tab delimited format. Can this be done? Thanks Select ... INTO OUTFILE: http://dev.mysql.com/doc/mysql/en/SELECT.html or mysql -e (documentation on the same page) HTH, Wolfram -- MySQL General Mailing List For list

Re: sub queries

2004-10-29 Thread Wolfram Kraus
Nathan Coast wrote: Hi apologies if this is a dumb question but can you do subqueries in mysql? select count(*) as RES from ACL_USER_GROUP_ROLE as UGR where UGR.USER_ID =2 and UGR.ROLE_ID = (select ROLE_ID from ACL_ROLE where ROLE_NAME = 'projectmanager' ) this query fails, but the

Re: Preserving backslashes in DML

2004-10-19 Thread Wolfram Kraus
Tom Kirkman wrote: What are the options available for inserting\updating a MySQL table VARCHAR with a string containing backslash characters so that the backslash characters are preserved as is? For example, the UNC string '\\MyServer\MyDir file:///\\MyServer\MyDir ' would be changed on the way

Re: multiple return values from SP or workaround ?

2004-09-02 Thread Wolfram Kraus
Wim Verhaert wrote: Is there any way to return multiple result variables from a stored procedure? And I guess the answer is NO. Or does anyone know how I can Concatenate (using the CONCAT function) to glue together my multiple results into one string that then can be post processed in perl.