Optimizer problem?

2008-02-20 Thread Tanner Postert
I have the following table: -- -- Table structure for table 'media' -- CREATE TABLE media ( id int(10) unsigned NOT NULL auto_increment, user_id int(10) unsigned default NULL, title varchar(255) NOT NULL, description text NOT NULL, `hash` varchar(255) NOT NULL, length float(9,2) NOT

problem forcing indexes

2008-01-03 Thread Tanner Postert
I have the following 2 tables: CREATE TABLE media ( id int(10) unsigned NOT NULL auto_increment, user_id int(10) unsigned default NULL, title varchar(255) NOT NULL, description text NOT NULL, `hash` varchar(255) NOT NULL, length float(9,2) NOT NULL, created timestamp NOT NULL

fulltext search option

2007-07-26 Thread Tanner Postert
I'm having a problem with the fulltext searching, and was looking for some help. i'm currently working with the following query: select table.* from table where match(title, description) against ('*search term*' IN BOOLEAN MODE) the reason I am using boolean mode, is so that it matches things

Re: replace / insert into with sum not working

2007-04-18 Thread Tanner Postert
was the braces around the select statement itself. Drop them and it should work fine. Now the REPLACE might be more elegantly handled with a INSERT...ON DUPLICATE KEY UPDATE.. construct, but that wasn't the question... On 4/17/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi Tanner, Tanner

Re: replace / insert into with sum not working

2007-04-18 Thread Tanner Postert
i am using 5.0.22 but i found the problem. i'm an idiot. there was a space in one of my sum(x) entries; sum (x), when i removed that, it worked fine. thanks. On 4/18/07, Tanner Postert [EMAIL PROTECTED] wrote: 5.0.22, does anyone know a workaround? On 4/18/07, Michael Dykman [EMAIL

replace / insert into with sum not working

2007-04-17 Thread Tanner Postert
i'm using the following query: REPLACE INTO vviews_total( SELECT uuser_id, sum( vviews.views ) AS views, sum( vviews.embeds ) AS embeds, sum( vviews.plinks ) AS plinks, sum( vviews.`30d` ) AS 30d, sum( vviews.`7d` ) AS 7d, sum( vviews.`24h` ) AS 24h, sum( vviews.site30d ) AS site30d, sum( site7d

Mode()?

2006-12-05 Thread Tanner Postert
Is it possible for mysql to return the mathmatical mode of a record set? (the record that occurs most often)

too many enum values?

2006-10-03 Thread Tanner Postert
how many is too many? i have a field with 21 possible values. each of the values are only 2 or 3 letter strings, but that seems like a lot, would it be faster/more efficient to put them in a separate table and just join?

mysql-bin.00000X

2006-08-30 Thread Tanner Postert
there are ton of these files in my mysql data directory on fedora core 5 they are about a GB a piece. it appears that they are snapshots or some kind of log file. what is creating these files?

table sizes, rolling data.

2006-08-29 Thread Tanner Postert

table sizes, rolling data.

2006-08-29 Thread Tanner Postert
sorry for the double post. if i want to have a row of about 100 records. and everytime i insert a new record, it gets pushed on the top, and the bottom one gets pushed out, sort of like a heap. is this possible? i know i can just delete the record, etc, but i was wondering if there was a built

random sort?

2006-08-13 Thread Tanner Postert
so if i have a list of records... id name other 1 water H2O 2 water aqua 3 water liquid so i want to select other where name = 'water' but i want to only return 1 result, and for that result to be a random value. is there a way to sort by rand() ? or something similar? or am i better of

previous and next query

2006-08-04 Thread Tanner Postert
so i have a record set: id user text 1 2 ... 2 6 ... 3 2 ... 4 4 ... 5 2 ... 6 8 ... 7 1 ... 8 8 ... 9 2 ... so lets say I am looking at record 3. i need to know the previous record in the table that has that user, as well as the next record in the table that has that user.

Re: Is this query possible?

2006-08-03 Thread Tanner Postert
the query works, but i need to get the total number of songs on that CD, as well as the sum of the lengths of the songs on the CD... is that possible in 1 query? On 8/2/06, Tanner Postert [EMAIL PROTECTED] wrote: just to clarify to Brent, the songs lists the original artist and album. the CD

Re: Is this query possible?

2006-08-02 Thread Tanner Postert
to sell. -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 2:13 PM To: Tanner Postert; mysql@lists.mysql.com Subject: Re: Is this query possible? I'm not sure why you split out track, track is really kind of an attribute of a song. Especially

Is this query possible?

2006-08-01 Thread Tanner Postert
ok, here is the schema that I am working with: CREATE TABLE `cd` ( `id` int(10) unsigned NOT NULL auto_increment, `user_id` int(10) unsigned NOT NULL, `title` varchar(100) NOT NULL, `description` text NOT NULL, `dt` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM CREATE TABLE

Re: Distinct problem

2006-07-18 Thread Tanner Postert
; PB - Tanner Postert wrote: The situation is somewhat hard to describe, so please bare with me: I am trying to group my results by the last activity on each row, my query looks like this select text, dt, item_id from table where group by item_id order by dt DESC here is an example

Re: Distinct problem

2006-07-18 Thread Tanner Postert
AS t2 ON t1.item_id = t2.item_id AND t1.dt t2.dt WHERE t2.item_id IS NULL; amazing what a little set of parenthesis will do. thanks anyways. On 7/18/06, Tanner Postert [EMAIL PROTECTED] wrote: the below query worked great in mysql 3.23, but we just moved to 5.0 and it broke, i can see

Re: enum query results strange.

2006-07-04 Thread Tanner Postert
, John Hicks [EMAIL PROTECTED] wrote: Tanner Postert wrote: so i am doing a query on an enum field: when i do this query: select *, id as vid, user_id as uid from video where (file_complete = 'true') order by undt desc limit 0,10; the results are 0.16 or 0.17 seconds. instead of saying

Re: Works in SQL Manager, but not PHP?

2006-07-03 Thread Tanner Postert
also, i would check that the user you are using for your mysql_connect in php has the permissions to do the create table, etc. On 7/2/06, Daniel Kasak [EMAIL PROTECTED] wrote: Brian Menke wrote: MySQL version 5.0.16 Windows XP PHP 5. I have this query that when I run it in SQL

enum query results strange.

2006-07-03 Thread Tanner Postert
so i am doing a query on an enum field: when i do this query: select *, id as vid, user_id as uid from video where (file_complete = 'true') order by undt desc limit 0,10; the results are 0.16 or 0.17 seconds. instead of saying file_complete = 'true. if i say file_complete != to the other 5

Distinct problem

2006-06-28 Thread Tanner Postert
The situation is somewhat hard to describe, so please bare with me: I am trying to group my results by the last activity on each row, my query looks like this select text, dt, item_id from table where group by item_id order by dt DESC here is an example record set. text1,2006-06-28