{"id":122,"date":"2004-01-13T22:36:00","date_gmt":"2004-01-13T22:36:00","guid":{"rendered":"http:\/\/new.tola.me.uk\/blog\/2004\/01\/13\/sql-blues\/"},"modified":"2004-01-13T22:36:00","modified_gmt":"2004-01-13T22:36:00","slug":"sql-blues","status":"publish","type":"post","link":"https:\/\/tola.me.uk\/blog\/2004\/01\/13\/sql-blues\/","title":{"rendered":"SQL blues"},"content":{"rendered":"<p>Not much happening at the moment. Done much more schoolwork recently than I had been doing. Computing in particular.<\/p>\n<p>I&#8217;ve had to get round the fact that mySQL doesn&#8217;t support subqueries until version 4.1 which is still in alpha release and <a href=\"http:\/\/mchicago.livejournal.com\/\" class=\"lj-user\">mchicago<\/a> thinks its a bad idea to install that on tralk. I wanted to do something like:<\/p>\n<p><code>SELECT * FROM RunStop a WHERE stopid=4 AND EXISTS (SELECT 1 FROM RunStop b WHERE b.runid=a.runid and b.stopid=23 AND a.id &lt;&gt; b.id);<\/code><\/p>\n<p>but I can&#8217;t, so I now have a piece of PHP code which puts the results of the first part of the query into an array and loops through that array, creating a new query based on each result to do the sub part of the query on. (that made sense before it came out of my head). Well anyway, I think it&#8217;s messy.<\/p>\n<p>Then there&#8217;s the fact that I can&#8217;t use INTERVAL with a TIME type, only DATETIME types. so instead of doing:<\/p>\n<p><code>SELECT * FROM `RunStop` WHERE time BETWEEN (&#039;07:30:00&#039; - INTERVAL 1 HOUR) AND (&#039;07:30:30&#039; + INTERVAL 1 HOUR)<\/code><\/p>\n<p>I have to do:<\/p>\n<p><code>SELECT * FROM `RunStop` WHERE (TIME_TO_SEC(time) - TIME_TO_SEC(&#039;07:30:00&#039;)) &lt;= 3600 AND (TIME_TO_SEC(time) - TIME_TO_SEC(&#039;07:30:00&#039;)) &gt;= -3600<\/code><\/p>\n<p>which is horridible. I haven&#8217;t even started on figuring out whether or not the bus travels on the right day&#8230;<\/p>\n<p>I complain about these things, but I&#8217;m actually really enjoying the programming. I hadn&#8217;t realised how long it is since I&#8217;ve done any proper programming I&#8217;ve been spending so much time learning how to use Linux.<\/p>\n<p>DT on the other hand is causing me headaches. My project is lacking direction quite terminally at the moment and I&#8217;m a bit fed up with it. I&#8217;m definately making progress in maths but no where near enough progress to get a B at the end of the year \ud83d\ude41 &#8211; yet.<\/p>\n<p><a href=\"http:\/\/lauperr.livejournal.com\/\" class=\"lj-user\">lauperr<\/a> is up and down like a yoyo, I really hope she doesn&#8217;t quit school. I wish she had a bit more confidence in herself because she&#8217;s such a great person with lots of talents.<\/p>\n<p>We had a disco in the IT room in our Computing Lesson\/break time as Mr M was away. It involved much dancing to music thanks to <a href=\"http:\/\/djkoa.livejournal.com\/\" class=\"lj-user\">djkoa<\/a> and dognuts and cookies thanks to <a href=\"http:\/\/lauperr.livejournal.com\/\" class=\"lj-user\">lauperr<\/a> and was hilarious.<\/p>\n<p><a href=\"http:\/\/wonchop.livejournal.com\/\" class=\"lj-user\">wonchop<\/a> has made a new animation, eels on wheels which I love (<a href=\"http:\/\/wonchop.hippygeek.co.uk\/eelsonwheels.htm\">here<\/a>) which reminds me, I still haven&#8217;t got a flash plugin for Mozilla Firebird.<\/p>\n<p>I think I have my first stats lesson with a lower sixth group tomorrow which will be fun :S<\/p>\n<p>Night night.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not much happening at the moment. Done much more schoolwork recently than I had been doing. Computing in particular. I&#8217;ve had to get round the fact that mySQL doesn&#8217;t support subqueries until version 4.1 which is still in alpha release and mchicago thinks its a bad idea to install that on tralk. I wanted to &hellip; <a href=\"https:\/\/tola.me.uk\/blog\/2004\/01\/13\/sql-blues\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SQL blues<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":0,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"wp:attachment":[{"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tola.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}