@# 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 15 16



Comments:

<0> Kcaj: Are you looking for the one row with the newest timestamp in the whole table, or one row for each unitID?
<1> ok and that stores the data in the tables?
<2> One row for each distinct unitid
<2> Jayinwww: If the SQL tells it to
<1> also would it be easy to use phpmyadmin for this?
<2> Jayinwww: Yeah, look on the first page
<0> and the query as shown above is giving you several rows with the same unitID?
<2> It has "Export" and newer versions also have "Import"
<2> snoyes: Yeah
<2> It looks liek it returned everything in the table
<0> did you cut and paste, or did you have to make some changes to the query?
<2> A little, here:
<2> $result = mysql_query('SELECT * FROM _ants a1 WHERE timestamp = (SELECT MAX(a2.timestamp) FROM _ants a2 WHERE a1.unitid = a2.unitid)');
<2> My line exactly
<0> hm, looks good to me. Do you have several rows with the exact same unitId and timestamp, but other values different?
<1> so I can do this right from the control panel then right? using phpmyadmin?



<2> Let me check
<2> Jayinwww: Yes
<2> Actually, lol, I have many duplicate entries, I guess that is why it is not working
<1> LOL
<1> gee great
<0> oh. In that case: SELECT DISTINCT... (the rest is the same)
<2> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM _ants a1 WHERE timestamp = (SELECT MAX(a2.timestamp) FROM _ants a2 WHERE a1' at line 1
<2> 'SELECT DISTINCT FROM _ants a1 WHERE timestamp = (SELECT MAX(a2.timestamp) FROM _ants a2 WHERE a1.unitid = a2.unitid)'
<0> select distinct * from
<2> Oh, haha
<1> LOL
<1> hmmm
<2> Same deal as before, still getting 7 results
<2> From onyl two disticnt unitid s
<0> how do the fields differ? Use the same concept as you have with the timestamp to pick one of those.
<2> (GPS1 and RAD1 are teh only two unitids, I see them both repeated through the 7 times)
<2> SELECT DISTINCT * FROM _ants a1 WHERE timestamp = (SELECT MAX(a2.timestamp) FROM _ants a2 WHERE a1.unitid = (SELECT DISTINCT(a2.unitid) FROM _ants)
<2> Something like that?
<2> Because that gives me a strange error, haha
<0> er, no
<0> what fields differ between the 7 results?
<2> Not many
<2> Soem are entire duplciate entries
<3> Xgc, Regarding the ORDER BY, didn't know. Seems odd to allow offsets...
<3> Harrison taught me about using FIELD() in ORDER BY...
<4> so i created a temporary table like 5 hours ago. i then decided to use a static table. so i dropped the temporary table and made a static table named the same. i added a field to the static table called Search_ID and now every once in a while in my php application i will get an error saying 'invalid column Search_ID'. Is this still the temporary table giving me crap?
<4> do i need to restart mysql?
<3> Temporary tables are connection specific.
<4> but i was using mysql_pconnect
<3> Don't.
<4> when i switch to mysql_connect the problem (so far) appears to go way
<4> but i like it!
<3> Why?
<4> it's faster
<3> Not really.
<4> all of my webpages pull content from the db
<3> When you use pconnect, you're using a connection that does not have that table.
<3> So?
<4> so it should be faster, no?
<3> No, it's not.
<3> Prove it.
<4> ok
<3> Prove it's faster.
<4> i will show some benchmakrs
<3> Great!
<4> give me 1 min and you can see for yourself!
<3> OK!
<3> I would have to say that if you make a test in one minute, it is 0% accurate.
<4> no
<4> i have benchmarking functions on my search
<4> i will turn them on and you can see
<3> It's been a minute...
<4> http://atomicdesigninc.net/boschweb/bosch_ip/search.php
<4> do a search for video
<4> this is with mysql_connect
<4> lemme know when your'e done
<4> and ill switch to pconnect
<4> it will say the microtime at the bottom
<3> That's not a very accurate test.
<4> oh come on!
<4> that is tight



<4> why not
<3> Do whatever you want. I don't care.
<3> But you are wrong.
<4> hey
<4> i thought we were having fun
<4> fine
<5> i'm getting more than 50ms of variance as it is...
<4> yeah
<4> i thought this is how ppl benchmark
<4> take the average
<5> in 5 tests, there was about 65ms from slowest to fastest
<5> yes, but benchmark results should be repeatable
<4> i know
<4> but there's no way to do it
<4> im just gonna average 3
<4> and then switch to pconnect
<5> well, what kind of numbers are we talking with pconnect?
<4> let's see which average is shorter
<4> all right
<3> !tell us about enter
<6> will[werk] asked me to tell you this: The enter key or return key is not a substitute for punctuation. Use a period '.', comma ',', colon ':', semi-colon ';' emdash'--', or elipsis '...' instead. In other words: DON'T HIT ENTER UNTIL YOU'RE DONE.
<4> so you got your 3 from connect?
<5> not yet, sec
<4> k
<4> ok switching now..
<4> switched
<4> lol..the stupid temporary table .... see!
<5> it appears to be consistently lower, but my highs and lows are still about what they were with connect
<4> yes i agree
<5> it's going to take a much MUCH larger sample to give the numbers any meaning
<4> but, in a larger application this will make a noticeable difference?
<4> the fact is we both saw pconnect be faster
<7> hi
<4> and this is just a simple search
<8> how do you select unique ids in the same query as the information ***ociated with them?
<4> what
<0> Kcaj: sorry, got called away. the distinct should prevent exact duplicate entries; there must be some difference.
<7> I installed mysql on gentoo quite a while ago, and I don't recall if I set anything up or not...but my root username and p***word doesn't appear to work
<7> does anyone have suggestions on how I can recover it?
<4> root/
<4> if you didnt set it atleast
<7> what do you mean root/
<7> ?
<4> p***word is blank on default
<4> that's all i got to help ya
<7> humm... access denied
<7> I've tried what should be the p***word, and getting nothing
<5> so i'm trying to figure out how to add a user from CLI...
<5> CREATE USER <user> ['<p***>']; isn't doing it
<9> depends on your version
<9> if it is pre 5.0 then use GRANT
<9> !man grant
<6> (GRANT and REVOKE Syntax) : http://dev.mysql.com/doc/mysql/en/GRANT.html
<7> where does mysql store the db again?
<7> is there anyway I can determine if there are any databases setup even?
<7> if there aren't any, I'll just remove it and start over
<9> login and issue "SHOW DATABASES;"
<7> leith: see above, I can't log in
<9> check the data directory then
<7> Leith: which is where?
<9> there will be directories in there for each database
<9> how did you install?
<9> and what OS?
<7> isn't that what I just asked?
<7> Gentoo
<7> ebuild
<10> Hey, I know this is wrong syntax, I cant seem to work out how to do it .. any ideas? - SELECT SUBSTR(tta_postcodes.postcode_postcode, 5) FROM `tta_postcodes`
<9> sorry I haven't been watching
<7> :)
<10> I want to get the first 5 letters from every 'postcode_postcode' returned :)
<9> check /usr/local/mysql/data or /var/lib/mysql
<5> Leith, it's 5.0.18
<9> pacmanfan: should create a user then
<9> is it shown in mysql.user?


Name:

Comments:

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






Return to #mysql
or
Go to some related logs:

#linux
#kde
#web
mainconcepts.com
pikhq
#perl
perl Too many open files at
#fedora
#lisp
ircnet The Warlords



Home  |  disclaimer  |  contact  |  submit quotes