Changed Number
I have loaded a large *.csv spreadsheet into mysql and one number, the grand total, changes from 16996941 on the Excel spreadsheet to 8388607 in the mysql database. The numbers surrounding this number are correct at all stages. I have reloaded, checked formatting and done various other things without success. Then I went to the text (*.sql) file in which I had dumped the mysql table, manually changed the number to 16996941 and put the text file on the server. However, the number that showed up on the web page table and the number in the database on the server is 8388607. Note that the smaller number is just under half of the larger number. This makes no sense. Any solutions? Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Excluding Rows
How do I exclude some rows in a table? I am merging columns from three tables all of which show all congressional districts in all states. I want to exclude those congressional districts in TX, PA and ME. My coding that brings up data for all congressional districts is shown below. Thanks. Ken ** select fh1109.state, fh1109.cd, fh1109.party, fh1109.representative, ssa1202.total, ((total-children*percentunder18)/vapall)*100, ssa1202.retired_workers, ssa1202.disabled_workers, ssa1202.widow, ssa1202.wives_and_husbands, ssa1202.children from ssa1202, fh1109, vapall where fh1109.state = ssa1202.state and fh1109.cd = ssa1202.cd and fh1109.state = vapall.state and fh1109.cd = vapall.cd and ssa1202.state = vapall.state and ssa1202.cd = vapall.cd -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Access Denied
I didn't get a response to the question below, and my alternative solution produced another error message as follows. Rather than try to establish a new database, I used the Test database established when I reinstalled mysql. With a csv file saved under mysql/data/test, I did a load data command exactly as I have done many times before and got ERROR 1045 Access denied for user: '@localhost' (Using password: NO) I was able to create the table and successfully issue the commands SHOW TABLES and DESCRIBE TABLENAME As below mysql is installed on a pc running Windows 98. Ken * Original Question: I have mysql installed on a pc running Windows 98. I recently had to reformat a partitioned c drive. My tables were stored in a database called samp_db. When I give the command use samp_db I get Error 1044: Access denied for user: '@localhost' to database 'samp_db' When I give the command create database samp_db I get the same error message, and I get the same when I try to create a database with another name. How do I create the database (and what is this error)? Can I get the tables back under samp_db (I saved all mysql files to the d drive)? Thanks in advance. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Finding Database and Tables
I have mysql installed on a pc running Windows 98. I recently had to reformat a partitioned c drive. My tables were stored in a database called samp_db. When I give the command use samp_db I get Error 1044: Access denied for user: '@localhost' to database 'samp_db' When I give the command create database samp_db I get the same error message, and I get the same when I try to create a database with another name. How do I create the database (and what is this error)? Can I get the tables back under samp_db (I saved all mysql files to the d drive)? Thanks in advance. Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Stop Scrolling
When I do mysqlSHOW TABLES \p less; I get the error message You have an error in your SQL syntax near 'less' in line 1 I am using dos, not unix. Ken ** On Mon, 31 May 2004 21:19:28 -0700, Robert J Taylor [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Ultimately simple, but I don't find the answer: how to stop a list from scrolling to the bottom when the command SHOW TABLES is entered. I assume you are referring to the command line of the mysql client? I use: mysql\P more or mysql\P less depending on my mood. Other client tidbits can be found using \h or \? at the * prompt. Ken HTH, Robert J Taylor [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Stop Scrolling
Thanks to everyone for responses, but the conclusion I'm reaching is that there is no simple command to stop scrolling of the table list in dos. As Hassan Schroder said, pager doesn't work in Windows, anyway. I did try mysqlSHOW TABLES \P less; and got an error message. I just don't understand why there isn't a simple, parallel command for a table list to, e.g., mysqlselect * from table1 limit 5; Ken ** On Mon, 31 May 2004 21:19:28 -0700, Robert J Taylor [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Ultimately simple, but I don't find the answer: how to stop a list from scrolling to the bottom when the command SHOW TABLES is entered. I assume you are referring to the command line of the mysql client? I use: mysql\P more or mysql\P less depending on my mood. Other client tidbits can be found using \h or \? at the * prompt. Ken HTH, Robert J Taylor [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Stop Scrolling
Ultimately simple, but I don't find the answer: how to stop a list from scrolling to the bottom when the command SHOW TABLES is entered. Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Sorting Varchar
I've just tried the three column solution (designating each column as null), but the empty cells produce a 0 just as the two cells with an actual 0. How do I avoid that, preferably with a blank in that place? * On Thu, 13 May 2004 13:53:37 -0400, Bill Easton [EMAIL PROTECTED] wrote: OK, I'm sorry. The solution I gave doesn't work. You need to have some sort of conditional in the sort expression so that numbers are sorted numerically and other things are sorted alphanumerically. I'm not aware of a test for numeric vaues in MySql, so you need to use some trick to differentiate between the two. This seems to work, provided there are no negative numbers and the text things start with letters ORDER BY IF (cost ':', LPAD(cost,10,'0'), CONCAT('1',cost)) In this, cost ':' tests if the string starts with a digit (':' is the character after '9') LPAD(cost,10,'0') pads the integer on the left with zeros -- replace the 10 with a number at least one more than the maximum number of digits CONCAT('1',cost) causes the text items to sort to the end (the numbers now start with '0') Pasha's solution is probably cleaner, but you have to change the table definition. For Pasha's solution to work, you would need to have the text_val column be null (or '') when the value is numeric. Subject: Re: Sorting Varchar From: [EMAIL PROTECTED] Date: Wed, 12 May 2004 18:13:17 -0400 That didn't do it. I got 0,0,1050,1168,1195, 1975, 150,155,16500,170,178. . . The non-numerics came out last (which I want). There are two zeros but no negative numbers. Any alternatives? Ken ** On Wed, 12 May 2004 07:47:11 -0400, Bill Easton [EMAIL PROTECTED] wrote: You could also use order by cost+0,cost. This puts the non-numerics first, then the numerics in numerical order. (You'd need to get fancier if there are non-numerics starting with a digit or numerics = 0.) From: Sasha Pachev [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How do I set up a column (cost) that contains numbers and text so that the numbers will sort the numbers accurately? Using varchar results in a sort based on the first digit, so that I get e.g. 1, 10, 100, 3. . . when the command is order by cost. Almost all of the text is By County. Ken: Consider having two columns - num_val, and text_val, and then order by num_val, text_val -- Sasha Pachev Create online surveys at http://www.surveyz.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Sorting Varchar
That didn't do it. I got 0,0,1050,1168,1195, 1975, 150,155,16500,170,178. . . The non-numerics came out last (which I want). There are two zeros but no negative numbers. Any alternatives? Ken ** On Wed, 12 May 2004 07:47:11 -0400, Bill Easton [EMAIL PROTECTED] wrote: You could also use order by cost+0,cost. This puts the non-numerics first, then the numerics in numerical order. (You'd need to get fancier if there are non-numerics starting with a digit or numerics = 0.) From: Sasha Pachev [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How do I set up a column (cost) that contains numbers and text so that the numbers will sort the numbers accurately? Using varchar results in a sort based on the first digit, so that I get e.g. 1, 10, 100, 3. . . when the command is order by cost. Almost all of the text is By County. Ken: Consider having two columns - num_val, and text_val, and then order by num_val, text_val -- Sasha Pachev Create online surveys at http://www.surveyz.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Sorting Varchar
How do I set up a column (cost) that contains numbers and text so that the numbers will sort the numbers accurately? Using varchar results in a sort based on the first digit, so that I get e.g. 1, 10, 100, 3. . . when the command is order by cost. Almost all of the text is By County. Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Convert MS Access to MYSQL
There was some discussion in December of converting MS Access databases to Mysql and the DBManager program was recommended. I have DBManager running and select Tools=Data Management=Import/Export Wizards, but the command is greyed out and won't activate. I am using Office 2000 and I have made sure that Preferences=Data=Use DAO 3.6 is checked as instructed. What am I doing wrong? Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]