@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info


Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13



Comments:

<no-dx> i need to somehow modify this query... http://pastebin.com/565769 so that test_attendees.ATTENDEE_ID = test_orders.attendee_records'%|'
<no-dx> but i don't know the syntax for a wild card off of a table.fieldname
<no-dx> could anyone help me?
<no-dx> ehlo?
<archivist> depends if your just going to swear at us again
<no-dx> i promise
<no-dx> can you help?
<no-dx> i just don't know the syntax for adding a wildcard to the end of test_attendees.ATTENDEE_ID = test_orders.attendee_records
<archivist> youve had good advise so far and cursed at everybody
<Andy298> how do i use mysqldump to insert data into an existing db?
<no-dx> ok well...
<no-dx> prolly cause whats happening now...
<no-dx> nothing
<HarrisonF> no-dx: use concat
<HarrisonF> no-dx: however it is going ot be horribly inefficient, just FYI
<no-dx> i know... i don't wanna use concat
<no-dx> i just wanna add a wildcard to the end...
<winmutt> what happens if mysql doesnt have swap space? does it create files in /tmp?
<HarrisonF> yes, concat a % then use LIKE
<Andy298> i've got "mysql -u root -p < dump.sql" but how do i just put ALL the tables in the dump to one database (just got tables in the dumb.sql file)
<HarrisonF> col LIKE 'a%'
<HarrisonF> winmutt: depends on the operation, it will normally create neccesary items in the tmpdir setting (which under unix is normally /tmp)
<no-dx> i don't wanna use concat
<HarrisonF> uhm, why not? it does what you want?
<winmutt> HarrisonF: what happens if /tmp get full?
<no-dx> harrisonF... its horribly inefficient...
<HarrisonF> winmutt: you will start getting errors back for queries where it needs it
<Andy298> any help with mysqldump?
<HarrisonF> no-dx: yup, a poor database design will do that
<no-dx> i just wanna add a percent like i would here... field = '%".$bleh."'
<HarrisonF> no-dx: i dunno why you are doing comparisons with wildcards between tables
<no-dx> are you going to keep telling me whats wrong with my database or just help me?
<HarrisonF> I DID TELL YOU
<HarrisonF> USE LIKE AND CONCAT
<no-dx> cause unconstructive criticism is useless..
<no-dx> I DON"T WANNA USE CONCAT
<winmutt> HarrisonF: a coworker is running optimize, swap was unmounted at the time, the tmp files were created and deleted
<HarrisonF> then you can't do what you want.
<no-dx> then why does it work here? field = '%".$bleh."'
<HarrisonF> that will look for %bleh
<HarrisonF> do you want a wildcard?
<no-dx> why can't i do it with table.field = table.field'%' or something...
<HarrisonF> because your syntax is wrong
<winmutt> HarrisonF: can we shutdown during the middle of OPTIMIZE
<no-dx> $bleh being a php variable...
<no-dx> then whats the syntax for that?
<HarrisonF> CONCAT()
<no-dx> oh my god
<no-dx> bah
<danfg> hmm
<danfg> ok i think this is a tough one: how can i tell mysql to count how many words or matches of a certain word are in a field?
<HarrisonF> winmutt: sure, or you can kill the OPTMIZE, it is okay to terminate
<danfg> preferably some regular expression
<danfg> it seems so obvious, but i haven't found a function that counts matches of a substring in a field
<winmutt> tnx harrison
<HarrisonF> danfg: don't think there is a way to count the number of matches...
<danfg> isn't that lame?
<no-dx> harrisonF... what about a for statement?
<no-dx> or foreach
<Darien> danfg: not really, no
<Darien> it's a database, not a text processing engine
<Darien> features like that are 'nice', but they're bonuses
<HarrisonF> you could in theory create a function to do it in 5.0
<danfg> Darien, what am i processing? mysql counts stuff too. it returns matches too. why can't it count matches? :)
<HarrisonF> danfg: it just isn't a really common thing to want to know, so it doesn't exist
<HarrisonF> danfg: but again, you could create a function to do it in 5.0
<danfg> HarrisonF, i'd argue that, but that would be pointless here :) thanks
<Darien> danfg: it counts rows
<kreg_work> i'm trying to see what mysql.user is. is that a table in the db named "mysql" ?
<danfg> Darien, i want to try some stuff before giving up. brb
<HarrisonF> kreg_work: the user table in the mysql database
<kreg_work> guess i've never seen a table named with a . before
<Darien> danfg: writing your own function would not be an entirely terrible idea
<HarrisonF> kreg_work: the table doesn't have a '.' that is specifying the hierarchy
<foxgamer> Hi all. I've just been recommended this room for starting up a database I can use on my website, but I have never even heard of sql. Can anyone point me to an idiots beginners guide?
<danfg> Darien: agreed. last resort though. i have to make sure mysql can't do that for me somehow. makes sense?
<archivist> !tell foxgamer about tutorial
<SQL> Alrighty.
<foxgamer> Thanks :)
<medusaXX> #1270 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT), (utf8_general_ci,COERCIBLE), (utf8_general_ci,COERCIBLE) for operation 'replace'
<medusaXX> what does that mean?
<medusaXX> i used char() in a replace()
<Poetic> Hello
<Poetic> Hello, is anyone there?
<Kaitlyn> what would be the most efficient way to grab all results from the past 12 months up to this month?
<Kaitlyn> newvermind.. hehe
<praseodym> I'm migrating a database from 4.0 on one server to 5.0 on another, and have problems with certain utf8 characters
<praseodym> what could be the problem
<fuffalo> i've got a table called event (with an id/title/description) and a table called eventdatetime (which has an event_id(which references my event table) and a date/time). I want to list all my events that are upcoming. I'm aware of how to JOIN the tables, I'm just stumped as to what I should use in my where clause when joining these tables - thanks
<BucWheat> hi all
<BucWheat> i have a table that is defined as data1 decimal(10,1) tstamp datetime and id int(10) unsigned auto_increment
<BearDK> how do I set the default value of a new field to current time? I've tried: ALTER TABLE `voip`.`VoIPKickedUsers` MODIFY COLUMN `createtime` DATETIME NOT NULL DEFAULT 'now()';
<BucWheat> inside this table the data actually looks like this
<purestorm> Hi. How do I compare a datetime (mysql 4.0) field against a datetime string?
<BucWheat> 6.3 2006-02-16 11:07:06 5
<BucWheat> i basically have a value for every second in time
<BucWheat> my question is is there a way to have mysql average up the data for one minute given the data i have in my table?
<Darien> BucWheat: sounds like you want date_diff()
<Darien> you want the last minute of data?
<Darien> SELECT AVG(data1) FROM table WHERE tstamp > DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MINUTE);
<Darien> err, >=
<btffmog> any ideas how I can get mysql 5.0 to accept 4.0-style p***word hashes?
<Punkwork> is there a formula to calculate mysqls total memory usage
<Darien> !m btffmog old client
<SQL> btffmog: (Client does not support authentication protocol) : http://dev.mysql.com/doc/mysql/en/Old_client.html
<btffmog> thanks
<Darien> np
<BucWheat> Darien let me show you my current query
<Darien> I'm friggin hungry
<BucWheat> SELECT * INTO OUTFILE "foo.txt" FIELDS TERMINATED BY '\t' FROM t_data1 where (tstamp >= date_format(date_sub(now(),interval 13 hour),?)) AND (data1 >= 0) ORDER BY tstamp DESC
<BucWheat> Darien this gives me the data from the table for 13 hours
<BucWheat> from now to 13 hours ago
<Darien> ok
<Darien> did you show me this because what I suggested doesn't give you what you want?
<BucWheat> Darien this is what i'm doing now and i wanted you to see it because i have to have the past 13 hours worth of data
<BucWheat> Darien i'm trying to add the averaging of data values in a minute based on the tstamp column
<BucWheat> this way it will cut down on my data plots when i try to plot this output in gnuplot
<Darien> did you try what I gave you?
<BucWheat> Darien i'm about to put it into console now
<Darien> ok
<BucWheat> the query you submitted works like a treat but it does it for all of the data in the table. i need to fix it to where it gives me the data1 date for every minute within the past 13 hours
<cyphase> what's wrong with..
<cyphase> timestamp datetime not null default 'now()'
<cyphase> i'm getting an error saying that it's malformed or something
<archivist> timestamp does not need now()
<archivist> !man timestamp
<SQL> (Overview of Date and Time Types) : http://dev.mysql.com/doc/mysql/en/Date_and_time_type_overview.html
<btffmog> fixed, thanks all
<BucWheat> Darien Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
<BearDK> cyphase: I asked that question 20 minutes ago. Please let me know if you figure it out
<BucWheat> i get that error when i run this query
<BucWheat> SELECT AVG(data1),tstamp INTO OUTFILE ? FIELDS TERMINATED BY '\t' FROM t_data1 where (tstamp >= date_format(date_sub(now(),interval 13 hour),?)) AND (data1 >= 0) AND (tstamp > DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MINUTE)) ORDER BY tstamp DESC
<cyphase> BearDK, it seems the author of the code made mroe mistaks then just that
<cyphase> more*
<BearDK> cyphase: I'm trying: ALTER TABLE `voip`.`VoIPChannels` MODIFY COLUMN `createtime` DATETIME NOT NULL DEFAULT 'NOW()';
<archivist> you cannot default to now()
<archivist> use a timestamp type
<BucWheat> Darien here it is without the outfile: SELECT AVG(gas),tstamp FROM graph where (tstamp >= date_format(date_sub(now(),interval 13 hour),"%Y-%m-%d %H:%M:%S")) AND (gas >= 0) AND (tstamp > DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 MINUTE)) ORDER BY tstamp DESC;
<Darien> BucWheat: oops
<BucWheat> how do i fix that?
<BucWheat> !man group by
<SQL> (GROUP BY Modifiers) : http://dev.mysql.com/doc/mysql/en/GROUP-BY-Modifiers.html
<BucWheat> Darien after further testing your query does not work
<BucWheat> i will hunt you down tomorrow because i have to run home now
<BucWheat> thanks for the help
<Darien> sure
<Renich> hi, guys!
<Renich> hey, one question... does this statement in SELECT table.whatever{1,2} expands to table.whatever1 table.whatever2
<Renich> anyone?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

+ubuntu +ipforwarding
apache key = e74
trivia v5 mckruger donwload
imerge gentoo
#gimp
#mysql
#qemu
#linux
allenknutsonsotherclass
#css



Home  |  disclaimer  |  contact  |  submit quotes