본문 바로가기

Example28

[MySQL] Partition 예제 ==> PARTITION 할 때 Column 하나에만 Primary Key 를 걸면 Error 발생. ==> 모든 Column 을 Partition 해야함. CREATE TABLE sales ( sales_id INT, sales_date DATE, amount INT, PRIMARY KEY (sales_id, sales_date, amount) ) PARTITION BY RANGE(YEAR(sales_date)) ( PARTITION p_2015 VALUES LESS THAN (2016), PARTITION p_2016 VALUES LESS THAN (2017), PARTITION p_2017 VALUES LESS THAN (2018), PARTITION p_others VALUES LESS THAN .. 2023. 1. 30.
[Rust] Web-Server 제작 (48일차) ==> 수신 스트림 대기 및 수신 시 msg 출력 // main.rs use std::net::TcpListener; fn main() { let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); for stream in listener.incoming() { let stream = stream.unwrap(); println!("Connection established!"); } } >> TcpStream 에서 오는 Data 출력 use std::io::prelude::*; use std::net::TcpStream; use std::net::TcpListener; fn main() { let listener = TcpListener::bind("12.. 2023. 1. 30.
[Rust] Thunk 예제 (47일차) fn main() { // Define and call a thunk let thunk = || println!("I am a thunk"); thunk(); // Defining a closure and storing it in a variable to be used later let closure = || { println!("This is a closure stored in a variable"); }; closure(); } fn main() { // Pass a thunk as an argument to a function fn call_thunk(thunk: &dyn Fn()) { thunk(); } let thunk = || println!("I am a thunk"); call_thunk(.. 2023. 1. 29.
[MySQL] With 예제 WITH RECURSIVE cte (n, fibonacci) AS ( SELECT 1, 1 UNION ALL SELECT n + 1, fibonacci + cte.fibonacci FROM cte WHERE n with를 통해 조건_1로 필터링 한 data를 조건_2로 다시 필터링 WITH cte AS ( SELECT * FROM table_1 WHERE condition_1 ) SELECT * FROM cte WHERE condition_2; https://chat.openai.com/chat 2023. 1. 29.