Demo-IDD-Chapter2-Part2.rar

  • PUDN用户
    了解作者
  • SQL
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 5
    下载次数
  • 2014-08-12 11:02
    上传日期
Demo SQL about SELECT....
Demo-IDD-Chapter2-Part2.rar
  • Demo-IDD-Chapter2-Part2.sql
    2.4KB
内容介绍
-- DEMO IDD CHAPTER 2 - PART 2 USE AdventureWorks -- USE IN & NOT IN (tim kiem theo 1 tap dieu kien) -- Tim nhung nhan vien co vi tri la Recruiter & Stocker) --C1: SELECT * FROM HumanResources.Employee WHERE Title = 'Recruiter' OR Title = 'Stocker' --C2: using IN SELECT * FROM HumanResources.Employee WHERE Title NOT IN ('Recruiter','Stocker') /* Su dung ky tu dai dien de tim kiem - Wildcard character - % dai dien cho bat cu tu nao - _ dai dien cho 1 ky tu nao - [abc] dai dien cho 1 ky tu bat ky trong chuoi abc - [^abc] dai dien cho 1 ky tu bat ky khong co trong chuoi abc */ -- Tim kiem cac phong ban co ten bat dau bang chu Pro SELECT * FROM HumanResources.Department WHERE Name LIKE 'Pro%' SELECT * FROM HumanResources.Department WHERE Name LIKE 'Marketin_' -- Tim ra cac phong ban co ten bat dau bang chu M,P,T SELECT * FROM HumanResources.Department WHERE Name LIKE '[MPT]%' -- TOP - tim kiem theo vi tri -- Tim ra 3 nhan vien co thoi gian nghi om nhieu nhat trong nam 1998 SELECT TOP 3 * FROM HumanResources.Employee WHERE HireDate >='1998/1/1' AND HireDate <='1998/12/31' ORDER BY SickLeaveHours DESC -- Tim kiem loai bo gia tri trung lap SELECT DISTINCT Title FROM HumanResources.Employee -- Su dung Function (ham`) SELECT function_name -- chuyen chu viet hoa SELECT upper('hoang ngoc anh') -- chuyen chu thuong SELECT lower('HOANG ANH DUNG') -- dem so luong ky tu SELECT len('Nguyen Hoang Tung') -- Y/c: Tim ra cac phong ban co ten bat dau bang chu P -- Y/c: ten phong ban phai viet hoa SELECT DepartmentID, 'Name'=upper(Name) FROM HumanResources.Department WHERE Name Like 'P%' --Ham lay ngay thang getdate() SELECT getdate() -- Ham cong ngay thang dateadd(date part, number, date) -- VD: Cong them 10 ngay vao HireDate cua toan bo nhan vien SELECT 'Hire Date'=dateadd(dd,10,HireDate) FROM HumanResources.Employee -- Cong them 1 nam vao HireDate cua toan bo nhan vien SELECT 'Hire Date'=dateadd(yyyy,1,HireDate) FROM HumanResources.Employee -- ham tru ngay thang datediff(datepart, date1, date2) -- VD: tinh tham nien lam viec cua toan bo nhan vien SELECT 'Tham Nien'=datediff(yyyy,HireDate,getdate()) FROM HumanResources.Employee -- Tinh tuoi cua toan bo nhan vien nu, sap xep theo giam dan SELECT 'Tuoi'=datediff(yyyy,BirthDate,getdate()) FROM HumanResources.Employee WHERE Gender = 'F' ORDER BY Tuoi DESC
评论
    相关推荐
    • Chartdemo.rar
      chartdemo用于显示图像,以二进制形式打开各种文件并读取其二进制码并以曲线形式显示出来,并提供一些简单的算法对原始数据进行处理并将处理后曲线显示出来
    • angularjsdemo
      angularjsdemo 一个简单的应用演示,展示了游戏部门网站上出售的一些游戏。 主要使用 AngularJS。
    • GameState demo
      Port GameState Demo(use OIS) to OGRE SDK1.4.5 <br>the orignol demo is here tutorial : ...demo with OGRE SDK1.4.5 I make a little change, and it works well with OGRE SDK 1.4.5. I am very ...
    • mschart demo
      国外网站下的一个DEMO,包括了饼图、曲线、柱状图的2、3D绘制,不要再下那些简陋的不足以遮羞的DEMO
    • jqueryDemo
      初学jquery的非常不错的demo (描述重点就可以了啊。还要有字数的限制。。 初学jquery的非常不错的demo 初学jquery的非常不错的demo 初学jquery的非常不错的demo )
    • quartzdemo
      C#下的定时任务demo,可以实现很多后台的服务,和自己的系统分开很方便,这是一个demo
    • demo
      git-demo
    • Demo DELTA.zip
      Demo Delta for Industry
    • demo.zip
      Write a small demo by yourself to check whether QT is installed normally
    • demo.rar
      图形化demo,直观效果明显,图形化演示demo,VISIONBOX