@# 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 14



Comments:

<0> DATEDIFF(au_born, CURRENT_DATE()) as age
<0> :-(
<1> excellent.
<2> ok guys i really don't get it about droping the user...can someone give an example of how they use it?
<1> Trixsey: age is a column alias and can't be used in the WHERE clause. Use a HAVING clause instead
<2> drop user 'titov'@'localhost';
<2> but that fails as well
<0> can I use both, inviso? a WHERE for other stuff, and a HAVING for the age only?
<3> inviso, I'm having trouble finding the exact syntax.
<1> titov: fails?
<1> Trixsey: yup
<2> inviso: ERROR 1268 (HY000): Can't drop one or more of the requested users
<1> titov: are you logged in as root?
<2> yes i am
<1> titov: how about drop user titov?
<4> can i use mysql to create a search engine?



<1> Mahmoud: of course
<2> that gives me the same error inviso
<1> zushiba: what part is giving you problems?
<4> inviso, why some people say use other databases?
<1> titov: how about drop user bogus;?
<4> inviso, any other better dbase for search engines?
<1> Mahmoud: You can use a csv file if you like... Heck, 17 highly trained monkeys could do it too.
<2> inviso: bogus being a real user?
<1> titov: nope
<3> I'm reading http://dev.mysql.com/doc/refman/5.0/en/string-functions.html, looking for the proper syntax to pull 1 result for each field which starts with a new letter.
<4> inviso, any idea what does google/yahoo use for thier search engine?
<2> ok same error inviso
<5> mahmoud: ... their owrn?
<5> er own?
<1> zushiba: the DISTINCT keyword gives you the one result per. If it gets more complicated, GROUP BY is used instead
<1> titov: hmmm. select User, Host from mysql.user;
<3> But they are all distinct.
<2> k moment
<6> Mahmoud search engines of that size are VERY specialised
<4> i want to create a search engine..
<1> Mahmoud: they built their own. It utilizes 10,000+ general purpose PCs as I remember and uses them just for their memory capacity. The main search engine runs fully in memory off a huge cluster.
<3> All the fields have different titles in them, I only need to pull A,B,C etc if there is a field that exists that starts with an A.
<2> the user is there as localhost
<3> or B
<4> inviso, wow
<1> zushiba: You mind throwing an example up in a pastebin. I'm clearly not understanding your question
<4> i want to make my hands dirty with search engines
<6> the original google research paper can be found on the net
<7> How can I swap 2 non-numeric values in a row? (from and to)?
<7> If say 50 messages have the from/to backwards in my table
<6> Mahmoud but what size of search engine
<3> I've not much sourcecode to paste really. it's just getting the a single query that does what I want.
<1> AaronCampbell: update table set col1=col2, col2=col1. I believe that works. If it breaks, you get to keep all the extra pieces
<0> inviso
<1> zushiba: not code, sample data and sample results so I can see what you're trying to accomplish
<4> archivist, a search engine made by perl and mysql.. it will be my home server, i'll let the web crowler coded by perl to work and collect sites for me, after one week i'll see what my search engine collected for me =)
<0> SELECT *, DATEDIFF(au_born, CURRENT_DATE()) AS age FROM animania_users WHERE CONCAT(au_first_name, ' ',au_last_name) LIKE '%Josef%' AND HAVING FLOOR(age/365)=18
<0> 18You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'HAVING FLOOR(age/365)=18' at line 1
<3> Ah, registering.
<7> :) thanks...that's why I didn't want to try...I thought it might order left to right (col1=col2, and then they are the same...so the second opperation does nothing)
<0> I shouldn't use AND?
<0> WHERE ... HAVING?
<1> Trixsey: nope
<1> !m Trixsey select
<8> Trixsey: (SELECT Syntax) : http://dev.mysql.com/doc/mysql/en/SELECT.html
<6> Mahmoud do some googling on search engines then
<2> anyone else have any idea on how to drop a user? on 4.1.1
<1> titov: bah, sorry. (leans over and whispers.. I hate the user management pieces in mysql relating to revoking privs and removing users. I tend to do it by hand :( )
<9> can i do some kind of case-insensitive compare with strings?
<0> inviso: SELECT *, DATEDIFF(au_born, CURRENT_DATE()) AS age FROM animania_users HAVING FLOOR(age/365)=18
<9> like, i don't want "MyName" to be a different username than "mynAME"
<0> doesn't return any rows
<0> but I'm 18!
<0> :(
<2> inviso: it's ok...thanks for the efforts though :-)
<7> inviso: it doesn't work. I did get it fixed though. Thanks
<10> I have a bunch of entries that have a blank first character. Does any one know a good way to select * where the first character is blank?
<1> AaronCampbell: good to know



<2> inviso: delete from mysql.user where user='username' and host='localhost'; then flush privileges;
<2> :-D
<3> inviso, http://hashmysql.org/paste/viewentry.php?id=1509
<0> Anyone around? :D
<1> titov: yup :) It's not recommended, but that's how I do it as well
<1> Trixsey: I ***ume you did the obvious and removed the Having clause so you could see the ages that were being calculated?
<0> inviso: Yes
<0> I only get NULL :(
<1> Trixsey: sounds like you need to get that fixed ;) Did you try selecting au_date to see if it even has data?
<1> zushiba: the sorting is easy. Sounded like you also wanted to generate a linked "header" to jump to each letter that's used?
<3> I'm unsure what you mean, I can cut the letter itself out in php i just need 1 return per new letter found with the query instead of a return for each record.
<3> letter or number, so if 5 fiels start with A, I get one A not 5.
<1> zushiba: Ok. I don't understand why, but the techinique is pretty common
<1> !m zushiba group-wise max
<8> zushiba: (The Rows Holding the Group-wise Maximum of a Certain Field) : http://dev.mysql.com/doc/mysql/en/example-Maximum-column-group-row.html
<1> zushiba: and instead of using max, you'll just order by something LIMIT 1 on the inner select
<3> hmm
<1> zushiba: it's not *exactly what you need, but the techinique is very similar
<3> yes, but does this require a numeric value?
<1> zushiba: That example uses a number, but not in general.
<11> Therion, Let's go "fishing" in the mountains.
<1> zushiba: bleh, maybe it's not clear enough.. Just a sec
<12> will: Forget that, let's just have ***
<13> do I need to restart mysql if I have made changes the users table? It shouldn't need to right, the changes are automatic?
<1> zushiba: something like select rowid, name, other_stuff from main_table JOIN (select substring(name, 1, 1) as letter, max(rowid) as tmp_rowid GROUP BY substring(name, 1, 1)) tmp ON tmp.tmp_rowid = rowid ORDER BY name
<1> doh
<3> OO
<1> note that I left off FROM main_table on the inner subselect :(
<3> I'll have to play around with that.
<1> does it make even a little bit of sense?
<1> the inner select finds a single rowid for each letter. The outer uses that to grab the full data from each row matching those rowids
<1> and no idea if I did the substring part right ;o)
<0> ah, I know now, inviso
<0> can I explode in MySQL?
<0> I store dates like this: 970223-0097
<3> Yeah it makes some sense.
<0> where -0097 is unique to sweden.. it's like.. a fingerprint for each person.. 4 last numbers
<3> SQL is backwards to me for some reason.
<0> so I need to separate the date from the four last numbers
<1> Trixsey: that's not a date, that's a violation of all that is lovely in this world
<1> store a date in a date column. Store other garbage in a seperate column
<0> I can't parse it somehow?
<0> or use some haxor functions on it?
<1> fix your data
<0> inviso: is it ok for a date to look like this: 97-02-23
<0> instead of 1997-02-23
<1> Trixsey: store.. it.. in... a.... DATE column
<14> Trixsey: left(messedupdatefield, 6) as validdate, right(messedupdatefield, 4) as uniqiefingerprintthingie
<0> inviso: no
<0> see no reason to :p
<0> ;'(
<0> evul
<14> but right
<0> inviso: it can be solved in other ways...!
<0> like shabbs suggested
<14> Trixsey: fix it once and not have to worry about it
<14> later
<0> shabbs: yeah but it'd be a waste of space
<0> to store both
<14> Trixsey: UPDATE yourtable SET newDateField = str_to_date(left(messedupdate, 6), '%y%m%d'), uniqueid = right(messedupdate,4);
<0> inviso: having two cols has to take more place than having one, either way
<1> Trixsey: You ***ume? How about the -?
<0> why can't I do it with one col?
<14> cuz mixing data is stupid
<0> its kewl
<1> !tell Trixsey about normalization


Name:

Comments:

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






Return to #mysql
or
Go to some related logs:

#awk
how to downgrade mesa version
php5-pdo+debian
#debian
linux shuts down at 94C
#perl
#css
cakephp prevent duplicated entries
#postfix
tslib+Segmentation fault



Home  |  disclaimer  |  contact  |  submit quotes