IDL> a = dblarr(4,4)
IDL> b=[4]
IDL> a[1,4]++
% Attempt to subscript A with <INT ( 4)> is out of range.
% Execution halted at: $MAIN$
IDL> a[1,b]++
IDL> print, a
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 1.0000000 0.0000000 0.0000000
IDL> b=[6]
IDL> a[1,b]++
IDL> print, a
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 0.0000000 0.0000000 0.0000000
0.0000000 2.0000000 0.0000000 0.0000000
This is quite annoying. I thought it was a bug (or feature) from IDL, but it seems that I didn't read the manual good enough. With the option
compile_opt STRICTARRSUBS this behaviour is not allowed anymore...Mari Minari from Support at Ittvis (formerly RSI) helped me out on this. Thanks!!
Just found out how to do a LEFT JOIN on combined tables with UNION. It's a bit tricky, but the point is that the result of a UNION is another table... See below:
SELECT `ID`, "whatever columns" FROM (
SELECT "whatever" FROM t1
UNION DISTINCT
SELECT "whatever" FROM t2
) AS newName1
LEFT JOIN
(
SELECT `ID` FROM t3
UNION DISTINCT
SELECT `ID` FROM t4
) AS newName2
ON `newName1`.`ID` = `newName2`.`ID` WHERE `newName2`.`ID` IS NOT NULL
Calendar



