journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,356 days old today.
prev day next day printable version

Entries this day: from-nhk mt3-brotherly-spat unions-require-distinct-values

from nhk

15:54 Tuesday 24 April 2018 JST

from https://www2.nhk.or.jp/school/movie/clip.cgi?das_id=D0005400130_00000

冬の野原。れた 植物 しょくぶつなど にこんなものを見ることがあります。カマキリの卵です。中を見ると、 あわのようなものにつつまれて、卵がぎっしりとな らんでいます。春になってあたた かくなると、卵から幼虫ようちゅうが生まれま す。体の長さは、およそ8ミリメートル。薄い膜に包まれています。薄い膜を 脱ぐと、形は成虫とほとんど同じ。幼虫は、昆虫などの生き物を食べて、大き くなっていきます。成虫になったカマキリです。カマキリは食欲旺盛です。大 きな鎌(かま)のような前脚で、餌を捕まえます。秋、カマキリの仲間が卵を 産む季節です。お腹の大きなカマキリをみつけました。メスのカマキリです。 卵を産む場所をさがしているのです。卵を産み始めました。卵は、泡のような ものの中に産みつけられます。この泡は乾くと固くなり、雨や風から卵を守り ます。こうしてカマキリの卵は、寒い冬を越すのです。

permalink

mt3 brotherly spat

13:32 Tuesday 24 April 2018 JST

{{< youtube hxZ3cE1Gh6c >}}

Curiously, I do not see the live stream that I broadcast today. Usually they are visible on Marble Track 3 YouTube channel immediately after upload.

permalink

unions require distinct values

12:30 Tuesday 24 April 2018 JST

I need to figure out why some code is not updating some tables.

But first I need a handy way to read the values and change the values.

I just discovered unions require distinct values.

SELECT 'jan', `arc_updated`, `marked_new`, `current_status_date`, `occupied_date`, `days_on_market`, `date_on_the_market`, `date_available`  FROM `units_2018_01_01` WHERE `unit_id` = 229
UNION 
SELECT 'feb', `arc_updated`, `marked_new`, `current_status_date`, `occupied_date`, `days_on_market`, `date_on_the_market`, `date_available`  FROM `units_2018_02_01` WHERE `unit_id` = 229
UNION
SELECT 'mar', `arc_updated`, `marked_new`, `current_status_date`, `occupied_date`, `days_on_market`, `date_on_the_market`, `date_available`  FROM `units_2018_03_01` WHERE `unit_id` = 229
UNION 
SELECT 'apr', `arc_updated`, `marked_new`, `current_status_date`, `occupied_date`, `days_on_market`, `date_on_the_market`, `date_available`  FROM `units_2018_04_01` WHERE `unit_id` = 229

Because the unit did not change over time, I have to add a fake different value to the UNION otherwise I get a single row.

And here is my sql to break the values

UPDATE `units_2018_01_01` SET `days_on_market` = '1' WHERE `unit_id` = 229;
UPDATE `units_2018_02_01` SET `days_on_market` = '2' WHERE `unit_id` = 229;
UPDATE `units_2018_03_01` SET `days_on_market` = '3' WHERE `unit_id` = 229;
UPDATE `units_2018_04_01` SET `days_on_market` = '4' WHERE `unit_id` = 229;

Here they are as single lines so I can copy-paste them easily.

UPDATE units_2018_01_01 SET days_on_market = '1' WHERE unit_id = 229; UPDATE units_2018_02_01 SET days_on_market = '2' WHERE unit_id = 229; UPDATE units_2018_03_01 SET days_on_market = '3' WHERE unit_id = 229; UPDATE units_2018_04_01 SET days_on_market = '4' WHERE unit_id = 229;

SELECT 'jan', arc_updated, marked_new, current_status_date, occupied_date, days_on_market, date_on_the_market, date_available FROM units_2018_01_01 WHERE unit_id = 229 UNION SELECT 'feb', arc_updated, marked_new, current_status_date, occupied_date, days_on_market, date_on_the_market, date_available FROM units_2018_02_01 WHERE unit_id = 229 UNION SELECT 'mar', arc_updated, marked_new, current_status_date, occupied_date, days_on_market, date_on_the_market, date_available FROM units_2018_03_01 WHERE unit_id = 229 UNION SELECT 'apr', arc_updated, marked_new, current_status_date, occupied_date, days_on_market, date_on_the_market, date_available FROM units_2018_04_01 WHERE unit_id = 229;

permalink
prev day next day