MySQL Update Join Oracle Merge Into๋ฌธ์ MySQL๋ก ๋ณํํ๋ค๊ฐ Update๋ฌธ์ Join์ ์ ์ธ ์ ์๋ค๋ ์ฌ์ค์ ์๊ฒ ๋์๋ค. UPDATE support_table A INNER JOIN member_table B ON A.sp_uid = B.user_id SET B.level=7 WHERE B.level=9 AND A.support_money > 10000 -- UPDATE ํ์ํ
์ด๋ธ A INNER JOIN ํ์ํ
์ด๋ธ B -- ON A.ํ์์์ด๋ = B.ํ์์์ด๋ -- SET B.ํ์๋ฑ๊ธ = 7 -- WHERE B.ํ์๋ฑ๊ธ = 9 AND A.ํ์๊ธ >= 10000 ๐ Reference ๋๋ณด๊ธฐ http://www.joshi.co.kr/index.php?mid=board_iuy..
Today I Learned/2022
LocalDate LocalDateTime ๋ณํํ๊ธฐ 1. LocalDate -> LocalDateTime LocalDate localDate = LocalDate.parse("2019-01-04"); //Beginning of the day LocalDateTime localDateTime1 = localDate.atStartOfDay(); System.out.println(localDateTime1); //Current time LocalDateTime localDateTime2 = localDate.atTime(LocalTime.now()); System.out.println(localDateTime2); //Specific time LocalDateTime localDateTime3 = localD..
Markdown ํ
์ด๋ธ ๋ด์์ ์ค๋ฐ๊ฟํ๊ธฐ(๊ฐํ) ๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. |์ ๋ชฉ ์
1|์ ๋ชฉ ์
2|์ ๋ชฉ ์
3|์ ๋ชฉ ์
4| |---|---|---|---| |๋ด์ฉ 1|๋ด์ฉ 2|๋ด์ฉ 3|๋ด์ฉ 4| |๋ด์ฉ 5|๋ด์ฉ 6|๋ด์ฉ 7|๋ด์ฉ 8| |๋ด์ฉ 9|๋ด์ฉ 10|๋ด์ฉ 11|๋ด์ฉ 12 ๋ด์ฉ 13| ์ ๋ชฉ ์
1 ์ ๋ชฉ ์
2 ์ ๋ชฉ ์
3 ์ ๋ชฉ ์
4 ๋ด์ฉ 1 ๋ด์ฉ 2 ๋ด์ฉ 3 ๋ด์ฉ 4 ๋ด์ฉ 5 ๋ด์ฉ 6 ๋ด์ฉ 7 ๋ด์ฉ 8 ๋ด์ฉ 9 ๋ด์ฉ 10 ๋ด์ฉ 11 ๋ด์ฉ 12 ๋ด์ฉ 13
Map ์ ์ธ๊ณผ ๋์์ ์ด๊ธฐํ ํ๋ ๋ฐฉ๋ฒ Map map = new HashMap() { { put("key1", "value1"); put("key2", "value2"); } }; Map map2 = Map.ofEntries( entry("key1", "value1"), entry("key2", "value2"), entry("key3", "value3")); Map.getOrDefault System.out.println(map2.getOrDefault("Key9999", "key not found")); // key not found ๐ Reference ๋๋ณด๊ธฐ https://devfunny.tistory.com/465
String ๋ณ์๊ฐ Null์ผ ๋ "" ์ป๋ ๋ฐฉ๋ฒ ์ฐจ์ธ๋ ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉฐ, ๋ฉ์๋๋ด์ String ๋ณ์๊ฐ ๋ฌด์กฐ๊ฑด Null์ด ์๋ ๊ฐ์ด ๋ค์ด์จ๋ค๊ณ ์๊ฐํ์ง๋ง ์๋ ๊ฒฝ์ฐ๊ฐ ๋ค์ ๋ฐ์ํด์ ์์๋ณด๊ฒ ๋์๋ค. ๋ค์ด์ฌ ์ ์๋ input ๋ฒ์๋ฅผ ์๊ณ ๊ฐ๋ฐํ๋ฉด ์ข๊ฒ ์ง๋ง ๊ทธ๋ฌ์ง ๋ชปํ๋ ์ํฉ์ด๋ผ ์์ ๋ฐฉ์์ผ๋ก NullPointException์ ๋ง๊ธฐ ์ํด ๋ก์ง๋ด์ ์ถ๊ฐํ๋ค. // standard in Java 7 String nullString = null; String emptyString = Objects.toString(nullString, ""); // In Java 9+. returns empty string if obj is null Objects.requireNonNullElse (nullString, ..