case用法(列舉條件選擇)
使用case(列舉條件選擇)就能夠實現
#!/bin/bash
echo "1. China"
echo "2. USA"
echo "3. England"
read -p "Please choose your country: " i
case "$i" in
1)
echo "Your country is China."
;;
2)
echo "Your country is USA."
;;
3)
echo "Your country is England."
;;
*)
echo "Please choose a right item."
esac
相關推薦
case用法(列舉條件選擇)
使用case(列舉條件選擇)就能夠實現#!/bin/bashecho "1. China"echo "2. USA"echo "3. England"read -p "Please choose your country: " icase "$i" in 1)
【TP5.1】whereOr的用法(雙條件查詢)
author:咔咔 wechat:fangkangfg 在平時的工作中,我們會遇到一些情況,比如; 最近我在寫TP5.1的商城部落格,裡邊就有一個這樣的需求 一個條件是校驗是否在角色許可權裡 一個條件就是需要校驗的許可權 這個時候就不知道sql怎麼
SQL進階隨筆--case用法(一)
SQL進階一整個是根據我看了pdf版本的整理以及自己的見解整理。後期也方便我自己檢視和複習。 CASE 表示式 CASE 表示式是從 SQL-92 標準開始被引入的。可能因為它是相對較新的技術,所以儘管使用起來非常便利,但其真正的價值卻並不怎麼為人所知。很多人不用它,或者用它的簡略版函式,例如 DECOD
Spring Data JPA動態查詢(多條件and)
ica cat 滿足 from pos true ans let tid entity: @Entity @Table(name = "data_illustration") public class Test { @Id @Gen
數據庫復習總結(16)-case關鍵字(數據透視)
isp b- event sub 多行 none 創建 pre group case語法: 練習1:將性別的0、1顯示為男、女 select * from StudentInfo --case:對結果集中的列進行判斷 --例1:顯示學生信息,性別以"男
科學計算工具箱Scipy的一些用法(持續學習更新)
ndimage 一個用來進行各種圖片處理的工具庫 讀取圖片: import scipy from scipy import ndimage import matplotlib.pyplot as plt num_px = 64 image = ndimage.imread(
mongoTemplate簡單用法(增刪改查)
分頁時查詢數量: 1 2 3 4
強化學習(RLAI)讀書筆記第十六章Applications and Case Studies(不含alphago)
強化學習(RLAI)讀書筆記第十六章Applications and Case Studies(不含alphago) 16.1 TD-Gammon 16.2 Samuel's Checkers Player 16.3 Watson‘s Dail
工作中學習到的css用法(持續更新中)
1.table中的內容水平垂直居中顯示 #id td{ vertical-align: middle; text-align: center; } <table id="id"></table> 2.div有最小高度,並且隨著內容的變化而變化
陣列和字串的方法與用法(陣列去重);
補充知識點:基類(object)的子類有哪些?Function,Array,Number,Boolean,String,Date,Math,RegExp String的兩種寫法:var st=new String("hello world") var st="hello
UNIX 屏障(barrier)的一個可能的簡單實現(使用條件變數)
UNIX 屏障(barrier)的一個可能的簡單實現(使用條件變數) typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; unsigned int count; }mpthread_barrier_t; int
MySQL - 如何提高SQL的查詢效率(where條件優化)
目錄 說在前面 35條優化規則 總結 說在前面 整天說SQL優化,SQL優化,到底怎麼才算是SQL優化呢,下面從百度總結了一些關於Oracle裡常用的一些有效的優化方法。僅供參考,文章內容來源於網路。 35條優化規則 (1)優先考慮建立索引 對查詢進行優化,應
Oracle - 如何提高SQL的查詢效率(where條件優化)
目錄 說在前面 34條優化規則 總結 說在前面 整天說SQL優化,SQL優化,到底怎麼才算是SQL優化呢,下面從百度總結了一些關於Oracle裡常用的一些有效的優化方法。僅供參考,文章內容來源於網路。 34條優化規則 (1)選擇最有效率的表名順序(只在基於規則的優
Greetings!(列舉子集+dp)
題意: 給n個信(信封有長寬和數目),問在找最多k種信封型別的時候,最少浪費多少紙 思路: 看了看題解,深以為然,這個思路很巧妙,也許是我太菜,沒細想。 我們首先二進位制列舉計算出,每種狀態下,這些信合用同一種信封時的浪費數目。 然後通過列舉子集,dp[ i ]
三十七、機架感知(副本節點選擇)及HDFS讀資料流程
機架感知(副本節點選擇)及HDFS讀資料流程 1、低版本Hadoop副本節點選擇 第一個副本在client所處的節點上。如
51微控制器 74hc595使用用法(利用proteus模擬)
文章為原創文章,轉載註明源地址。 一、介紹 百度百科介紹: 74HC595是一個8位序列輸入、並行輸出的位移快取器:並行輸出為三態輸出。在SCK 的上升沿,序列資料由SDL輸入到內部的8位位移快取器,並由Q7'輸出,而並行輸出則是在LCK的上升沿將在8位位移快取器的資料
springboot+jpa查詢(拼接條件查詢)
最近在學習springboot使用jpa操作資料庫,總結一下。 Dao層建立與JavaBean對應的介面,繼承JpaRepository<K,E>介面 @Repository public interface AccountDao extends JpaRepository&
C#字典Dictionary的用法(注重效能版)
內容會持續更新,有錯誤的地方歡迎指正,謝謝! 前言 以鍵值對Dictionary<[key], [value]>形式存值,和雜湊表很像也是一種無序的結構。 要使用Dictionary,需要先匯入C#泛型名稱空間System.Collecti
queue的常見用法(deque不知道)
1、queue的定義 queue<typename>name 2、queue容器內元素的訪問 由於queue本身就是一種先進先出的限制性資料結構,因此在STL中只能通過 front()來訪問隊首元素,或是通過back()來訪問隊尾元素 3、常用函式 ①
淺談struts2標籤中的2個很常用的標籤的用法(radio和select)
1.如圖所示我們需要在前臺的頁面通過radio和select將對應的資料庫中的資料顯示到選項當中,這也是我們做專案中經常需要做的,動態的顯示,而不是靜態的顯示。 首先我們需要在頁面中匯入str