Learning SQL Second Edition phần 3

Cả hai char và varchar được sử dụng trong một thời trang tương tự như trong tất cả các máy chủ cơ sở dữ liệu lớn. Oracle cơ sở dữ liệu là một ngoại lệ khi nói đến việc sử dụng varchar. Oracle người dùng nên sử dụng các loại varchar2 khi xác định các cột nhân vật có chiều dài thay đổi | mysql SELECT emp_id fname Iname start_date title - FROM employee - WHERE title Head Teller J I emp_id I fname I Inarnel start date title 6 I Helen I Flemingl 2008-03-17I Head Teller I 10 I leeilii Robertsl 2 eei-07 - 27 I lleel I e I lie I 13 I Johnl Blakel 2004-05-lli O i adTt Z l ejr i 16 I Theresa I Markham I 2005-03-15 I Head Teller I 4 rows in set In this case the where clausefilteredout 1o of the IHcmployccrows. This where clause IllllllllIlllllllllIlllllllllIllllllllllllIlllllllllllllI individual conditioma ieseperetidusing operators such as and or and not see Chapter 4 for acomplete discustion of thewhere clause an d filter conditions .Hare s an extension ollde ntevionsquerythatinclud esasecandconditien staOncthalonlylCose employees with a start date later than January 1 2006 should be included r 7 J J mysql fSLeae sms_il fname -remit s1irt_date usttt - FROMpmalgaed f - FHfRl úl 1 d fnadTe1lpa - Ani effpO_late sso6-ed-os f I emp_id I fname l lnv - start_date I title 6 I Helen l F lerninjtl 2008 03 1 1 HeadTeller I 10 I Paula Roberts I 2006-07-27 I Head Teller I II The first conditi on ti u e a . L ad Telfo r filterfd o ut 1. of 18 employee rows and IllllllllIlllllllIlllllllllIllllllllllllIlllllllllllllI leaving 2 rowsit ueoainolresuheot. Let s see what would happen if you change the operator srpaaeting the two condition from and to 0r mysql t-LtfT ai-_id -nasii Oeame startjfaie tttlt - FROS employee - fSTSl t pt Se 1 Sngd Tenils - fS d1saPnste 2dt6-dl-ai 1 I emp_id I -fnarne I Iname I start_date I title 2 Su sin 1 Barker 1 2006-09-12 1 Vice President 4 IllllllllI 1 Hawthorne llllllllllIll I 5 i Olin 1 Goodtng 1 2007-11-14 1 Lcxnaxrnager 6 Helen I llllllllllIll I HeadTeller 7 chri s 1 Tucker 1 a 8l-09 - 1H 1 Tender 8 Sarah 1 Parker 1 xe 2-02 1 1 tei9e 9 i a ne 1 Grossmin 1 2006-Oi-OH 1 -. I di 10 Pa ula 1 IOIi. - s 1 t -07 - 27 1 llacjetiii 12 Samintha 1 Jerneson 1 2007-01-08 1 Teller 13 H ohn Wake 1 2 W-05 - 11 HeadTeller the iiiie iieuse I 53 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
7    78    2    01-06-2024
31    95    2    01-06-2024
173    270    2    01-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.