Willette: Bythebeach: and to make sure the tunnel stays open, check out autossh
Verplanck: Sonny_Jim: sqlfiddle.com is an easy way to share your schema, your data, and the queries you’re testing. It saves us time and makes it more likely that you’ll get an answer! Make sure you set it to use MySQL.
Py: Yeah that would be easier, thx
Willette: Sonny_Jim: SELECT sku,HEXsku FROM all_tbl WHERE LENGTHsku=1 LIMIT 5; — pastie.org the result please
Willette: Sonny_Jim: ***uming sku is varchar
Brauner: English expression for “I’ll be just a second”
Willette: Sonny_Jim: see the 0D in the hex column? its not empty. it contains a linefeed character
Willette: Sorry, a carriage return
Zadina: Makes sense to me now, thanks Vacuity
Deems: I have an issue with a php website I was handed
Bogar: I have a query that runs fine by itself, but when it is ran multiple times it slows the server to a crawl and maxes out mysql
Keiter: Graffix2: did you run explain on it?
Gunthrop: I have not, let me google that
Kuchler: Graffix2: See http://dev.mysql.com/doc/refman/5.6/en/using-explain.html
Hoene: Graffix2: http://dev.mysql.com/doc/refman/5.6/en/execution-plan-information.html and http://dev.mysql.com/doc/refman/5.6/en/explain.html
Siverd: Given this data http://pastie.org/10429248
Olguin: I would like to calculate the change in the two locations pu_rates where date 2 is the more recent value and date 1 is the older value
Pirozhkov: Any thoughts on how I would go about doing this?
Paugh: Expected out put would be two rows of percentages. one for each location
Deerdoff: I can do the percentages but am having trouble trying to figure out how to select the records to base it on.
Correl: Hcker2000: What trouble?
Correl: Hcker2000: Are the dates guaranteed to be consequitve?
Zephyr: It could be date_id 52 compared to date_id 1
Lupfer: I already have the query to get the date_id’s
Correl: Hcker2000: So it is little more complicated, but still possible to JOIN ON date_id
Paschal: Bascially I want to always compare the newest date to say the date three months back
Reichmann: Salle, ok what are you thinking?
Correl: Hcker2000: If you know these dates in advance it is trivial
Hanni: Salle, I do. mind showing me the way ?
Correl: Hcker2000: trivial self join ON location_id WHERE date1 = AND date2 =
Correl: Hcker2000: Simply join the table to itself.
Whisler: Ok and then just specify a where for the primary select of date_id = 2?
Correl: Hcker2000: SELECT . FROM drops d1 JOIN drops d2 ON d1.location_id = d2.location_id and the rest should be obvious
Correl: Hcker2000: Using your example data: http://pastie.org/10429278
Rijos: Ok and how much more complex would it be if I wanted to calculate the average percent change over say the last four dates?
Correl: Hcker2000: If the latest date is unknown and you want to compare it to some older unknown date it is more complicated, but still doable
Correl: Hcker2000: There is AVG function, but be careful with it because it is one of the aggregate functions to be used with GROUP BY
Correl: Hcker2000: As for “last four dates” all you need is to translate it to proper WHERE clause
Stenbeck: Yea I know of avg and I’m guessing you could probably use an IN clause for the where
Herny: If I grab a list of dates first based on some other criteria
Mandich: How am i suppose to escape the char ” if not by doing ” ?
Charley: What error do you get?
Kovalcin: Mandich: if you used in your code, make it
Spies: One level of escaping for your programming language, another for mysql