RE: BUG: DATE_ADD 99999 fails, but 9999 works.

2007-08-31 Thread Daevid Vincent
and then use the user's local TZ, you need to use 'timestamps'. But then you can't use them for years past 2038... However 'datetime' will store any date, but you can't store in UTC and display via the TZ setting. :-\ -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent

BUG: DATE_ADD 99999 fails, but 9999 works.

2007-08-27 Thread Daevid Vincent
using 9 as the DATE_ADD interval value will result in 000-00-00 but one less 9 will work. root# mysql --version mysql Ver 14.12 Distrib 5.0.41, for pc-linux-gnu (i686) using EditLine wrapper CREATE TABLE `Users` ( `CoreID` int(10) unsigned NOT NULL auto_increment, `Username`

RE: BUG: DATE_ADD 99999 fails, but 9999 works.

2007-08-27 Thread Daevid Vincent
-Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 5:04 PM To: Daevid Vincent; 'MySQL General' Subject: Re: BUG: DATE_ADD 9 fails, but works. At 4:56 PM -0700 8/27/07, Daevid Vincent wrote: using 9 as the DATE_ADD interval

RE: BUG: DATE_ADD 99999 fails, but 9999 works.

2007-08-27 Thread Daevid Vincent
-Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 5:45 PM I don't think this is a bug. I think what's happening is that your timestamp column can't hold that date, it's max value is somewhere in 2038. You appear to be correct, burried in the

MySQL Ends Enterprise Server Source Tarballs

2007-08-10 Thread Daevid Vincent
Is this anything to be concerned about? We are Enterprise customers. We distribute mySQL on our appliance that we sell. It doesn't seem like we should worry, now. But I'm a little nervous about the future? http://linux.slashdot.org/article.pl?sid=07/08/09/2047231

RE: 2007 MySQL Community Survey - Got Ten Minutes to Spare?

2007-08-06 Thread Daevid Vincent
So I was gonna take this survey (I don't need or care about the book, just wanted to help you out) and honestly, it's more like a quiz -- needless to say I didn't do it. :-| -Original Message- From: Jay Pipes [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 2:33 PM To:

RE: How can I delete a block of random rows?

2007-08-06 Thread Daevid Vincent
-Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Saturday, 4 August 2007 12:41 PM Subject: Re: How can I delete a block of random rows? Daevid Vincent wrote: I have a SQL dump that I load in for testing with lots of interesting data. I want to now

How can I delete a block of random rows?

2007-08-03 Thread Daevid Vincent
I have a SQL dump that I load in for testing with lots of interesting data. I want to now pair that down to a smaller subset, however I can't just delete from a range of ID's, as the data is sequential. I want to delete say 1000 random rows from the table. ÐÆ5ÏÐ

Best way to backup three live databases

2007-07-30 Thread Daevid Vincent
We've got a production system with three databases. The three databases together represent one logical set of data. The databases contain a mixture of MyISAM and InnoDB tables. What is the best way to backup the entire system (i.e. all three databases) to ensure that I get a coherent snapshot

RE: MySQL Magazine - Issue 1 available NOW!!!!

2007-06-11 Thread Daevid Vincent
Message- From: Yves Goergen [mailto:[EMAIL PROTECTED] Sent: Saturday, June 09, 2007 4:34 AM To: Daevid Vincent Cc: 'B. Keith Murphy'; 'MySQL General' Subject: Re: MySQL Magazine - Issue 1 available NOW On 04.06.2007 23:44 CE(S)T, Daevid Vincent wrote: Thanks for the magazine. I already

RE: MySQL Magazine - Issue 1 available NOW!!!!

2007-06-04 Thread Daevid Vincent
Thanks for the magazine. I already incorporated a little extra SQL injection checking into my db.inc.php wrapper... //[dv] added to remove all comments (which may help with SQL injections as well. $sql = preg_replace(/#.*?[\r\n]/s, '', $sql); $sql = preg_replace(/--.*?[\r\n]/s, '', $sql); $sql =

RE: MySQL Magazine - Issue 1 available NOW!!!!

2007-06-04 Thread Daevid Vincent
article On 6/4/07, Daevid Vincent [EMAIL PROTECTED] wrote: Thanks for the magazine. I already incorporated a little extra SQL injection checking into my db.inc.php wrapper... //[dv] added to remove all comments (which may help with SQL injections as well. $sql = preg_replace

RE: How to get the table.column in mysql client tab completion? Or feature request to add this.

2007-05-25 Thread Daevid Vincent
Daevid Vincent wrote: [snip] Also, it would be great if mysql client was smart enough to limit my tab completion choices to possibilities based upon the current SQL query I'm crafting. So If I have: select t[TAB] from ResolveTable join Tickets; It should only show me

FK support on myISAM, Parallelization, pronunciation and all kinds of goodness...

2007-05-24 Thread Daevid Vincent
Whoa!? I was just reading this page (http://en.wikipedia.org/wiki/MySQL), and noticed a few things... http://en.wikipedia.org/wiki/Foreign_key Foreign key support for all storage engines will likely be released with MySQL 5.2 (although it has been present since version 3.23.44 for

How to get the table.column in mysql client tab completion? Or feature request to add this.

2007-05-24 Thread Daevid Vincent
Is there a way to get the full table.column always in mysql client when using the auto-tab completion feature? I'm currently using 5.0.36. The way it works now is a bit confusing. Notice I have TWO different DateOnly columns (for example) in two different tables. [middle column] mysql select

FW: Two Denial of Service vulnerabilities in mySQL 5.0.38

2007-05-14 Thread Daevid Vincent
Sorry if this was already posted, but I don't recall seeing it, and I read the list every day. I also checked here: http://lists.mysql.com/mysql and didn't see any mention. This makes me a little concerned. Why aren't these security issues being posted to the list? This is at least the third

RE: dbnightly maintenance backup script

2007-05-10 Thread Daevid Vincent
Thanks for sharring Ofer. I'll throw the one I wrote and use into the mix too. http://daevid.com/examples/daily_backup_tgz.sh Simply put it in your /etc/cron.daily/ And then every so often monitor /backups/ and delete stuff that's getting old. (it does some cleanup) d -Original

RE: How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'? [SOLVED]

2007-05-10 Thread Daevid Vincent
-Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Friday, May 04, 2007 1:22 AM To: mysql@lists.mysql.com Subject: How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'? I'm having trouble figuring out the logic/query I

RE: How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'?

2007-05-09 Thread Daevid Vincent
-Original Message- From: Iain Alexander [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 09, 2007 3:11 PM To: mysql@lists.mysql.com Subject: Re: How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'? On 4 May 2007 at 1:21, Daevid Vincent wrote

How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'?

2007-05-04 Thread Daevid Vincent
I'm having trouble figuring out the logic/query I want. I know that all those ORs are not right. I'm doing this in PHP and mySQL (of course), so if it can't be done with a single query, I can split it up. Here's the challenge, given a text field search box, someone enters: Sony 20 TV

RE: How do I find products when a user types freeform strings like 'Sony 20 TV' or '20 Sony TV'?

2007-05-04 Thread Daevid Vincent
-Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Daevid Vincent wrote: I'm having trouble figuring out the logic/query I want. I know that all those ORs are not right. I'm doing this in PHP and mySQL (of course), so if it can't be done with a single query, I

RE: INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet so far...

2007-04-30 Thread Daevid Vincent
-Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED] Because if you wanted that you'd use REPLACE which is mysql specific which is okay since it's mysql you're using I guess. Except for the CRITICAL issue that REPLACE will DELETE the row first, thereby causing all

INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet so far...

2007-04-27 Thread Daevid Vincent
Maybe this is some SQL standard implementation and that's why it is what it is, but to me it seems completely retarded that you have to explicitly call out the columns... http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html Why doesn't it work in a more convenient and sane way?! So

FW: MySQL patches from Google

2007-04-25 Thread Daevid Vincent
A co-worker sent this to me, thought I'd pass it along here. We do tons of failover/replication and would be eager to see mySQL implment the Google patches in the stock distribution. If anyone needs mission critical, scaleable, and failover clusters, it's Google -- so I have every confidence their

Postgres Engine for MySQL Released

2007-04-01 Thread Daevid Vincent
http://developers.slashdot.org/article.pl?sid=07/04/01/1448207from=rss One of the unique qualities of the MySQL server is its ability to have multiple storage engine operate concurrently. Companies like Oracle and Solid have contributed their own storage engines to the open source project. With

Why doesn't the InnoDB count() match table status?

2007-03-26 Thread Daevid Vincent
Aside from the incredibly annoying fact that InnoDB tables don't store a total COUNT(), my question is... Why are these numbers different? I could easily parse out the second query which is REDICULOUSLY faster. BTW, why doesn't mySQL just 'alias' the first query behind the scenes for us and parse

RE: Why doesn't the InnoDB count() match table status?

2007-03-26 Thread Daevid Vincent
In the last episode (Mar 26), Daevid Vincent said: Aside from the incredibly annoying fact that InnoDB tables don't store a total COUNT(), my question is... Why are these numbers different? I could easily parse out the second query which is REDICULOUSLY faster. BTW, why doesn't

RE: Why doesn't the InnoDB count() match table status?

2007-03-26 Thread Daevid Vincent
Is mySQL planning on fixing this BUG. YES -- it is a BUG. A BIG FAT HARRY ONE. I think you mean 'hairy', not 'harry'. There are no 'harry' bugs, apart LOL! Doh! Yeah. I was so blinded by rage that I forgot my spelling. It's completely stupid that I can't query and get an

RE: Why doesn't the InnoDB count() match table status?

2007-03-26 Thread Daevid Vincent
You're about 5 years too late for this converation, but I recall it Really? People have just happily accepted this absurd limitation for _five_ years? Wow. having to do with the fact that when you're on a table that supports transactions, you don't know exactly how many records a particular

RE: Are there any tools to get diff (alter commands) between tow tables ?

2007-03-21 Thread Daevid Vincent
I wonder if there are any tools to do a diff between two tables struture to result alter command to convert table A structure to table B structure ? Yes, our tool Database Workbench includes a so-called Schema Compare tool which allows you to compare structures and create a

RE: Possible in sql, or just move it to a language

2007-03-15 Thread Daevid Vincent
I'm just guessing at this, but I think this is a simple update: UPDATE table1, table2 SET table2.needs_purging = 1 WHERE table1.bounce_email = table2.email http://dev.mysql.com/doc/refman/5.1/en/update.html You could also do this same logic with the delete I believe: DELETE table2

Is there a professional quality mySQL GUI for Linux?

2007-03-15 Thread Daevid Vincent
Can anyone recommend a real, quality, professional level mySQL GUI for Linux? KDE, Gnome, whatever. Doesn't matter. Beggars can't be choosers right. Something along the lines of SQLYog (Enterprise ideally). I'm kind of disappointed that I can't seem to find anything. They're all either some

RE: Is there a professional quality mySQL GUI for Linux?

2007-03-15 Thread Daevid Vincent
/licensing.html -Original Message- From: Ow Mun Heng [mailto:[EMAIL PROTECTED] Sent: Thursday, March 15, 2007 1:37 AM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Is there a professional quality mySQL GUI for Linux? On Thu, 2007-03-15 at 01:25 -0700, Daevid Vincent

InnoDB does not preserve AUTO_INCREMENT -- WTF!?

2006-11-10 Thread Daevid Vincent
http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-column.html We have recently switched several database tables from MYISM to INNODB, only to find out this colossal design flaw in InnoDB tables. We ship out mySQL on our appliances in enterprise level scenarios. We often like to start

ORDER BY RAND() gives me duplicate rows sometimes

2006-11-09 Thread Daevid Vincent
I am using this query to pull three random comments from a table: SELECT *, DATE_FORMAT(created_on, '%b %D') as date_format FROM comments ORDER BY RAND() LIMIT 3; The problem is that sometimes, I get two of the same comment. How can I refine this query to give me 3 unique/distinct ones? --

RE: What's the PHP equivallent of mysql mydb somefile.sql

2006-10-10 Thread Daevid Vincent
Could you be more specific? What is SOURCE? Where do I use that? I tried to search, but I find a lot of hits related to source code. -Original Message- From: Ligaya A. Turmelle [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 6:57 PM To: Daevid Vincent; mysql@lists.mysql.com

RE: purging bin logs

2006-10-10 Thread Daevid Vincent
http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html DÆVID -Original Message- From: George Law [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 11:56 AM To: mysql@lists.mysql.com Subject: purging bin logs Hi All, I have a question on purging some old

What's the PHP equivallent of mysql mydb somefile.sql

2006-10-09 Thread Daevid Vincent
Currently I run an 'updater' script to run through a directory of .sql files using something like this in PHP: $COMMAND = mysql .$OPTION['db_prefix'].$db. .$mydir.$filename; system($COMMAND, $ret); What would be the equivallent way to to this in a PHP mysql_query(); way? I see

RE: How can I extract 3 IDs from only 2 columns/rows?

2006-10-06 Thread Daevid Vincent
, 2006 6:13 AM To: 'Daevid Vincent'; mysql@lists.mysql.com Subject: RE: How can I extract 3 IDs from only 2 columns/rows? I'm a newbie, for sure, but can't you use OR to accomplish this? SELECT * FROM release_hack WHERE BID IN (5749, 7355, 6454) OR oBID IN (5749, 7355, 6454); Could

How can I extract 3 IDs from only 2 columns/rows?

2006-10-05 Thread Daevid Vincent
I have written a bug tracking system (http://sourceforge.net/projects/roachphp which is pretty out of date currently). It has a feature to regress a CR (change request, previously known as a bug). That is, if you fix a CR in maint, you can duplicate it to trunk so that you can test it there too.

RE: Getting next Birthdays

2006-09-12 Thread Daevid Vincent
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html Read the comments at the bottom. DÆVID -Original Message- From: ESV Media GmbH [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 8:05 AM To: mysql@lists.mysql.com Subject: Getting next Birthdays

RE: PHP script to simply manage tables

2006-08-11 Thread Daevid Vincent
I know you asked for PHP, but you might look into Ruby on Rails. 'scaffold' can make a whole lot of stuff like that almost trivial... http://www.rubyonrails.org/ DÆVID -Original Message- From: thomas Armstrong [mailto:[EMAIL PROTECTED] Sent: Friday, August 11, 2006 4:02 AM To:

RE: cell colors PHP/MySQL

2006-08-10 Thread Daevid Vincent
No. a switch requires 'testing' the condition, and for every row. The CSS way is much more efficient (and preferred for best practices) as it's more flexible. You can change the CSS file easily without changing any PHP code. But the speed will be the biggest improvement. A wise man once told me,

Calculating birthdays and distances... Is there a bug?

2006-08-04 Thread Daevid Vincent
I posted this as a comment on the page too, but I’m curious as to why the top solution is off by a day or so... Is this a bug or a rounding issue or what? Is there a way to fix the top one to work the way I expect/want it to work? I suspect it's because (as Jack Palance said in 'City Slickers')

FW: How do I find all the users that are new since my last login (repost)

2006-08-04 Thread Daevid Vincent
I have a SQL challenge I'm not sure how to solve. But it's so common, I feel kind of stupid asking this... I have a 'user' table with 'login_date' which is an auto updated DATETIME column and a 'created_on' which is a DATETIME (but not updated after the record is created the first time) I want

RE: FW: How do I find all the users that are new since my last login (repost)

2006-08-04 Thread Daevid Vincent
:[EMAIL PROTECTED] Sent: Friday, August 04, 2006 5:35 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: FW: How do I find all the users that are new since my last login (repost) You could add an extra field called last_login_date which you'd set only once per session - at login

I have 972 vmware-bin.000XXX files!

2006-08-03 Thread Daevid Vincent
I use a VMware for LAMP development work. I just looked in my /var/lib/mysql dir and there are 972 of these vmware-bin.01 ... vmware-bin.000972 files! Yipes! Do I need them? Can I delete them? How do I prevent them from being created all the time? Can't they all just go into one vmware-bin

How do I find all the users that are new since my last login

2006-08-03 Thread Daevid Vincent
I have a SQL challenge I'm not sure how to solve. But it's so common, I feel kind of stupid asking this... I have a 'user' table with 'login_date' which is an auto updated DATETIME column and a 'created_on' which is a DATETIME (but not updated after the record is created the first time) I want

[ANNOUNCE] dumpster :: dumps out all related records in a mySQL InnoDB database

2006-07-12 Thread Daevid Vincent
Hey all. Well I just finished my first version of a little tool I have affectionately dubbed dumpster. I do use my own SQL wrapper functions, but they should map fairly cleanly to a search and replace for the stock PHP mysql_*() ones, or your own ones. Mad props to Peter Brawley [EMAIL

RE: PBXT version 0.9.5 has been released

2006-07-06 Thread Daevid Vincent
Your site has a bunch of JS errors (using IE) so I can't roll over ANY of the menus (left or upper right). I also cannot write to 'contact' because of this same error. Hence I send it here... To the list... *sigh* Can I also suggest not using a dark red hyperlink with black text. I didn't even

Need way to see all relations?

2006-06-30 Thread Daevid Vincent
Is there a way with InnoDB tables to see all related tables/columns? Basically what I want to do is make a script that somehow will dynamically create a backup of a single user record. But I don't want to have to manually add a new table or column everytime to the script. So for example, I have

RE: Need way to see all relations?

2006-06-30 Thread Daevid Vincent
-Original Message- From: Peter Van Dijck [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 6:32 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Need way to see all relations? That is, as far as I know, impossible. Mysql does not know which tables are related to which

RE: Need way to see all relations?

2006-06-30 Thread Daevid Vincent
EXCELLENT! Thanks! -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 8:31 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Need way to see all relations? Daevid, I have a 'users' table. And there are all kinds of related

RE: Reset (or Defrag) the AUTO_INCREMENT columns

2006-06-14 Thread Daevid Vincent
I keep this little chart tacked to my wall: # BIGINTUNSIGNED = 8 Byte = = 18446744073709551615 # INT UNSIGNED = 4 Byte = = 4294967295 # MEDIUMINT UNSIGNED = 3 Byte = FF = 16777215 # SMALLINT UNSIGNED = 2 Byte = = 65535 # TINYINT UNSIGNED =

RE: MySQL (GPL License)

2006-06-07 Thread Daevid Vincent
However, it is very reasonable and desirable to support MySQL as a company, as they save us all tons of money over Oracle, MS-SQL, etc., in addition to providing an excellent product. So even if you don't need the commercial license, if your company depends upon MySQL, buying a

RE: Automatically add +1 every 30mins

2006-06-03 Thread Daevid Vincent
Kudos! I read a lot of replies to various threads hoping to learn something, and this thread was a double bonus. Never new of the 'events' feature either. But I think this solution below is very elegant and is one of those so obvious it makes me feel retarded answers. ;-) Personally, I would

How do I add a column only if it doesn't exist?

2006-05-24 Thread Daevid Vincent
I want to do something like this: if not exists `hotel_page_templates`.`hpt_custom_fields` alter table `hotel_page_templates` add column `hpt_custom_fields` text after `hpt_alternate_username`; ÐÆ5ÏÐ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

How do I turn off error checking

2006-05-24 Thread Daevid Vincent
want the SQL to fail on any errors b/c then I know the upgrade is hosed. This is a special case where some people got a SQL upgrade (by hand) and some didn't, hence the discrepency between the schemas. DÆVID -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent

RE: How do I turn off error checking

2006-05-24 Thread Daevid Vincent
As mentioned in the original email, I know about forcing it, but I can't do that in my case. DÆVID -Original Message- From: sheeri kritzer [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 6:27 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: How do I turn off

Need a query to show distinct IP dotted quad components

2006-05-19 Thread Daevid Vincent
I have a table of many IP addresses. I'm doing some PHP/JS/AJAX to populate a select box based upon what someone types in a search field. That works great, except that a user can spend a lot of time guessing as to what possible IPs exist. What I'd like to do now is one of those google

RE: Need a query to show distinct IP dotted quad components [SOLVED]

2006-05-19 Thread Daevid Vincent
I may have just solved my own problem: SELECT DISTINCT(SUBSTRING_INDEX(INET_NTOA(IP_Addr), '.', 3)) as niceip FROM IPTable HAVING niceip LIKE '192.168.15%'; http://dev.mysql.com/doc/refman/5.0/en/string-functions.html -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED

RE: Recursive query = Nested Set

2006-05-18 Thread Daevid Vincent
I think you might consider refactoring your code to use a hybrid of Nested Sets and Adjacency List. It's fairly trivial to add a 'parent_id' to the nested set, so you really don't loose any of your existing schema structure, but it will be much faster to traverse a tree, and no recursion is

Need help with triggers

2006-05-15 Thread Daevid Vincent
This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup in the zipcode table. DELIMITER $$; DROP TRIGGER `store_coord`$$ create trigger `store_coord` BEFORE INSERT

RE: Need help with triggers

2006-05-15 Thread Daevid Vincent
This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup in the zipcode table. DELIMITER $$; DROP TRIGGER `store_coord`$$ create trigger

Help with subqueries...

2006-04-28 Thread Daevid Vincent
vmware reviewit # mysql --version mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline 5.1 Given two tables: CREATE TABLE `logs` ( `id` bigint(20) unsigned NOT NULL auto_increment, `user_id` int(10) unsigned default '0', `created_on` timestamp

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
-Original Message- From: Alex Arul [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 11:28 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Help with subqueries... On 4/28/06, Daevid Vincent [EMAIL PROTECTED] wrote: vmware reviewit # mysql --version

RE: Help with subqueries... MAX() and GROUP BY

2006-04-28 Thread Daevid Vincent
Thanks Alex, that got me started. I don't understand why I had to use IN when the example uses = but at least it kinda works... The problem is now that I can't get the right data. mysql select max(created_on), user_id, id from logs group by user_id;

RE: Help with subqueries... MAX() and GROUP BY [sovled]

2006-04-28 Thread Daevid Vincent
| +-+-+-++--+ From: Alex Arul [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 2:18 AM To: Daevid Vincent Subject: Re: Help with subqueries... MAX

VIEW not working with myODBC in XP and Access 2003

2006-04-26 Thread Daevid Vincent
I have a critical problem that I hope there is a simple solution for. I've just spent a couple days converting a very messy hack to populate a table using a much more elegant VIEW solution now. Everything is going great, except now the whole point of this VIEW is so that people using MS Access

RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)

2006-04-25 Thread Daevid Vincent
I'm so confused. I'm finally getting around to needing to do a 'store locator' thing. I procured myself some zip/lat/long databases from various places. Then I noticed that for the same zip code, I got different values in different databases??!!! So for a sanity check, I decided to look online

RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)

2006-04-25 Thread Daevid Vincent
Thanks for the graph. So are you saying that I should use the database that has the negative values, and not the one that uses positive values? I'm in the USA. I don't care about anywhere else (for my location needs that is). -Original Message- From: Jay Blanchard [mailto:[EMAIL

RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)

2006-04-25 Thread Daevid Vincent
6:03 AM To: mysql@lists.mysql.com Subject: RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude) On Tue, 2006-04-25 at 00:43 -0700, Daevid Vincent wrote: So for a sanity check, I decided to look online and punch in some to see what the real lat/long should be. Well

How can I use a value computed in my SQL query for further computations?

2006-04-17 Thread Daevid Vincent
Here is a paired down version of a query I want to make. How can I get the grandtotal column? I know about the HAVING clause, but that's only going to be good for weeding out rows I don't want. I just want to do some basic math here. SELECT a.*, DATE_FORMAT(a.created_on,'%m/%d/%y

RE: How can I use a value computed in my SQL query for further computations?

2006-04-17 Thread Daevid Vincent
to use PHP to do basic math on the table when mySQL can do it probably faster. -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 7:33 PM To: mysql@lists.mysql.com Subject: How can I use a value computed in my SQL query for further

RE: How can I use a value computed in my SQL query for further computations? [solved]

2006-04-17 Thread Daevid Vincent
:=(views * ppview)) AS totalviews, (@tc:=(clicks * ppclick)) AS totalclicks, @tv + @tc AS grandtotal FROM advertisements a ORDER BY grandtotal desc; Thanks Jay for your ideas. Daevid. -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Monday

FW: New to TRIGGER and CALL. Example gives errors. (repost)

2006-04-11 Thread Daevid Vincent
This may have been lost, so I'm reposting hoping for a clue as to why the mySQL example onlie gives me errors... -Original Message- Sent: Sunday, April 09, 2006 7:41 PM I'm trying to follow the example in the manual to create a trigger:

RE: FW: New to TRIGGER and CALL. Example gives errors. (repost)

2006-04-11 Thread Daevid Vincent
Green [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 12:41 PM To: Daevid Vincent; mysql@lists.mysql.com Subject: Re: FW: New to TRIGGER and CALL. Example gives errors. (repost) --- Daevid Vincent [EMAIL PROTECTED] wrote: This may have been lost, so I'm reposting hoping

New to TRIGGER and CALL. Example gives errors.

2006-04-09 Thread Daevid Vincent
I'm trying to follow the example in the manual to create a trigger: http://dev.mysql.com/doc/refman/5.0/en/using-triggers.html #DROP TRIGGER upd_check; delimiter // CREATE TRIGGER upd_check BEFORE UPDATE ON starkeys FOR EACH ROW BEGIN IF NEW.skey 1 THEN SET NEW.skey = 1;

RE: Update Multiple Records

2006-03-18 Thread Daevid Vincent
update myTable set status = 'completed' where id IN (10,20,30,40,50) LIMIT 5; I believe that should work. As a precaution, I recommend always using LIMIT x whenever possible on SELECT, UPDATE or DELETE statements. This will minimize any accidental dammage to other records should you have

RE: Boolean searches on InnoDB tables?

2006-03-06 Thread Daevid Vincent
Osku is working on FULLTEXT for InnoDB. So, despite what the documentation says: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html Which states: They can work even without a FULLTEXT index, although a search executed in this fashion would be quite slow. You're saying that InnoDB

How to make a social network?

2006-03-06 Thread Daevid Vincent
Anyone have some pointers at a HowTo on creating a social network? Basically I need to show people in your immediate network, and also friends of your friends, etc... Like the whole 'six degrees of separation' thing. Ala: myspace, friendster, etc. ad nauseum. I prefer mySQL and PHP, but I could

Boolean searches on InnoDB tables?

2006-03-03 Thread Daevid Vincent
I just discovered this: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html Which states: They can work even without a FULLTEXT index, although a search executed in this fashion would be quite slow. But then I'm kicked in the nuts because:

Nested Set Model or modified preorder tree traversal mySQL/PHP code wanted

2006-02-21 Thread Daevid Vincent
I've been searching the web for the past few hours trying to find a simple drop-in class or functions to implement Nested Set Model or modified preorder tree traversal. I've found several tutorials and related links: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

RE: Fastest way to log IP's

2006-02-07 Thread Daevid Vincent
I work at a security company, and we store many thousands of IPs in mySQL for networks as large as /16. Use INTEGERS. It's much more efficient. It's easier to use. And it allows your sorting (ORDER BY) to be in the proper order. If you stored as characters you'd eroneously get: 192.168.1.1

mySQL LINT / Schema checker?

2005-09-27 Thread Daevid Vincent
We use SVN to commit our code, but sometimes a dev will commit broken SQL schema. We use php -l to validate all php prior to allowing the checkin, wondering if there is some simmilar tool for mySQL (we're migrating to v5.0 if that helps) to prevent broken schema syntax from sneaking into our

INSERT record IF NOT EXISTS?

2005-08-17 Thread Daevid Vincent
Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this EXISTS but not an example of how to use it with INSERT. I see INSERT... ON DUPLICATE KEY UPDATE col_name=expr which is very close, but I want it to do nothing on duplicate key. :(

RE: telnet localhost 3306 Connection refused [SOLVED]

2005-07-11 Thread Daevid Vincent
is running? Is it possible that you have skip_networking in your configuration file? See: http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html Daevid Vincent [EMAIL PROTECTED] wrote: What is causing me to have this problem in mysql Ver 12.22 Distrib 4.0.24

telnet localhost 3306 Connection refused

2005-07-07 Thread Daevid Vincent
What is causing me to have this problem in mysql Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i686). I am running shorewall, but that shouldn't affect localhost should it? My firewall, web, and mySQL server are the same machine. # telnet localhost 3306 Trying 127.0.0.1... telnet: Unable to

ORDER BY and ENUM -- not alphabetical

2005-06-08 Thread Daevid Vincent
Please tell me there is a way to fix this bug in mysql Ver 12.22 Distrib 4.0.18, for pc-linux-gnu (i686) I have a column defined like so: Type enum('Schedule','Report','Admin','Search','General','License','Access') If I SELECT, and ORDER BY Type, it is ordering in the order defined by the the

Question about combination PRIMARY keys and INDEX

2005-04-20 Thread Daevid Vincent
If I have a table with a primary key like this: CREATE TABLE `answers` ( `qid` INT UNSIGNED NOT NULL , `userid` INT UNSIGNED NOT NULL , `groupid` INT UNSIGNED NOT NULL , `comments` TEXT NOT NULL , PRIMARY ( `qid` , `userid` , `groupid` ) ); But I will also be searching in various pages, for

RE: license question

2005-03-30 Thread Daevid Vincent
As my company and I understand it, if you intend on distributing mySQL on this appliance and the appliance is a sealed box with your own proprietary code (like PHP or C or Java or whatever) that interfaces to the STOCK/Untouched RDBMS, you NEED a mySQL Commercial License. This license is a

RE: license question

2005-03-30 Thread Daevid Vincent
Yeah. It's silly. The whole hardware x86 1U rack mount we use with 2.4Ghz proc, 256MB, 40GB HD, dual Gbps NICs is only $500. I don't know what crack the mySQL AB guys are smoking to think that they are competitive. We've already started to wrap our product SQL calls in our own API so we can

mysqldump and missing AUTO_INCREMENT=1000 ??

2005-03-29 Thread Daevid Vincent
I have a table that I created by hand like this: DROP TABLE IF EXISTS testset; CREATE TABLE testset ( id int(10) unsigned NOT NULL auto_increment, name varchar(50) NOT NULL default '', special enum('','all','safe','unsafe') NOT NULL default '', PRIMARY KEY (id), UNIQUE KEY name (name)

Erroneus column using MAX() and GROUP BY

2005-03-16 Thread Daevid Vincent
I have this table: mysql select historyvlan_time, historyvlan_vlan, v.clienthistory_id from pe_historyvlan as v join pe_clienthistory using (clienthistory_id) order by historyvlan_vlan, historyvlan_time desc; +--+--+--+ | historyvlan_time |

How can I find the records that are NOT IN the list

2005-02-24 Thread Daevid Vincent
I have an IN() list of 107 IDs (PK) out of about 6000 possible. I do this query and I get 105 rows back. I want to know which two [107 - 105 = 2] of the IDs in the IN() list are absent? # 105 rows SELECT count(*) FROM mytable WHERE id IN (11704, 10144, 11842, 11299, 11192, 11563, 11378,

RE: Is there something broken with IN()? -- SOLVED

2005-02-24 Thread Daevid Vincent
My bad. As it turns out, there are duplicates in the IN() listing. It must be that mysql 'uniques' the list before operating on it. -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 5:14 PM To: mysql@lists.mysql.com Subject

Is there something broken with IN()? WAS: How can I find the records that are NOT IN the list

2005-02-24 Thread Daevid Vincent
V2_Data.pluginlist_view WHERE scan_id = 10329 LIMIT 1 108 SQL: SELECT scan_id FROM V2_Data.pluginlist_view WHERE scan_id = 11510 LIMIT 1 109 SQL: SELECT scan_id FROM V2_Data.pluginlist_view WHERE scan_id = 10539 LIMIT 1 total = 110 -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent

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? --

Need help with historic aggregation of data

2005-02-11 Thread Daevid Vincent
I need to get the aggregate data from various tables for a report. The idea is that we audit devices daily on a schedule, and also allow users to audit the devices by choosing certain tests to run. It is also the case that new tests are added daily. So the scheduled test today has more tests than

RE: How can I count() on multiple tables in a single query? SOLVED

2004-07-12 Thread Daevid Vincent
= UserDept.DeptID GROUP BY Departments.DeptID, Departments.DeptName ORDER BY DeptName DESC; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 12, 2004 6:39 AM To: Daevid Vincent Cc: [EMAIL PROTECTED] Subject: Re: How can I count() on multiple

<    1   2   3   4   >