I am using SQL regularly among other languages. So I am approaching kdb+ with that mindset. There are a couple of constructs in SQL that I like and use as I find them helpful.
- MERGE:
MERGE target_table T
USING source_table S
ON T.key1=S.key1 AND T.key2=S.key2
WHEN MATCHED THEN UPDATE SET T.value1=S.value1
WHEN NOT MATCHED BY TARGET THEN INSERT (value1) VALUES (S.value1)
WHEN NOT MATCHED BY SOURCE THEN DELETE;
See http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm#SQLRF01606
I searched this forum but couldn’t find anything related. To get the same result in kdb+, do you have to use separate insert/update/delete statements like in older SQL days?
-
In SQL you can have defaults for columns and as such you don’t have to specify values for all columns when inserting a row into a table. Is there anything like that in kdb+?
-
I am guessing kdb+ doesn’t have the concept of auto-incremented column, right? Probably not much needed anyway or easily simulated, but just wanted to make sure.