
'Namespace: System.Text.RegularExpressions
Regex 數字 檢查: Regex.IsMatch(Me.txtB1.Text, "^[0-9]*[1-9][0-9]*$")
colud77 發表在 痞客邦 留言(1) 人氣(6,062)

'Math.Round 做四捨五入
Sub Main()
Dim x, y, z As Integer
Console.WriteLine(" 成績計算系統 ")
Console.WriteLine("=================")
colud77 發表在 痞客邦 留言(0) 人氣(1,867)
UNION 指令的目的是將兩個 SQL 語句的結果合併起來。從這個角度來看,
UNION 跟
JOIN 有些許類似,因為這兩個指令都可以由多個表格中擷取資料。
UNION 的一個限制是兩個 SQL 語句所產生的欄位需要是同樣的資料種類。另外,當我們用
UNION 這個指令時,我們只會看到不同的資料值 (類似 SELECT
DISTINCT)。
colud77 發表在 痞客邦 留言(0) 人氣(994)

取時間變數 , 抓今天的變數來做查詢條件
a. 將今天轉成七碼 民國年月日 select @wDate = CONVERT (VARCHAR(7), GETDATE(),12 )+0890000 2007/4/16 =>960416 算出n天前的年月日 DECLARE @wDATE VarChar(7),@n int SET @n = 45 select @wDate = CONVERT (VARCHAR(7), GETDATE()-@n,12 )+0890000
colud77 發表在 痞客邦 留言(0) 人氣(262)

'使用"in" 搜尋select * from xxx where 欄位1 in('xx1','xx2','xx3'.......)取代了select * from xxx where 欄位1='xx1' or 欄位1='xx2'........更好用的是可以配合使用次查詢select * from xxx where 欄位1 in(select 欄位1 from xxx2 where.....)
colud77 發表在 痞客邦 留言(0) 人氣(50)
Replace函數Geography 表格
| region_name | store_name |
| East | Boston |
| East | New York |
| West | Los Angeles |
| West | San Diego |
colud77 發表在 痞客邦 留言(0) 人氣(188)

Create 語法create database stuednt #建立一個新的資料庫建立一個新的資料表create table student (
id smallint not null auto_increment,
account varchar(12) binary not null,
name varchar(12) not null,
sex tinyint(1) default 0 ,
date datetime,
primary key(id)
)
colud77 發表在 痞客邦 留言(0) 人氣(44)

Insert Into(新增記錄)
Insert Into 資料表 (欄位串列) Values (欄位串列值)
例如:
Insert Into StuData (no, name) Values (100, '幕之內一步')
colud77 發表在 痞客邦 留言(0) 人氣(111)

Update(更新記錄)
Update 資料表 Set 指定運算式 Where 條件式
例如:
Update StuData Set name= '鳴人'
colud77 發表在 痞客邦 留言(0) 人氣(354)

Delete(刪除記錄)
Delete From 資料表 Where 條件式
註:省去Where時,會清除所有記錄
例如:
Delete From StuData Where sex='男'
colud77 發表在 痞客邦 留言(0) 人氣(120)