Guest User

Untitled

a guest
Dec 11th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. q)tab:([]col1:`a`b`c;col2:1 2 3)
  2.  
  3. q)select i,col1,col2 from tab
  4. x col1 col2
  5. -----------
  6. 0 a 1
  7. 1 b 2
  8. 2 c 3
  9. q)
  10. q)exec i from tab where col1=`b
  11. ,1
  12.  
  13. q)tab2:([] index:2 3;col3:"yz")
  14. q)
  15. q)tab2
  16. index col3
  17. ----------
  18. 2 y
  19. 3 z
  20.  
  21. q)(select index:i,col1,col2 from tab) lj 1!tab2
  22. index col1 col2 col3
  23. --------------------
  24. 0 a 1
  25. 1 b 2
  26. 2 c 3 y
  27.  
  28. t:([] id:1 2 3)
  29.  
  30. select from t where i=1
  31.  
  32. output--> id:2
  33.  
  34. t:delete from t where i=1
  35.  
  36. select from t where i=1
  37.  
  38. output--> id:3
Add Comment
Please, Sign In to add comment