亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? query.sgml

?? 關系型數據庫 Postgresql 6.5.2
?? SGML
字號:
 <Chapter ID="query">  <TITLE>The Query Language</TITLE>  <Para>   The  <ProductName>Postgres</ProductName>  query language is a variant of   the <Acronym>SQL3</Acronym> draft next-generation standard. It   has many extensions such as an extensible type  system,   inheritance,  functions and production rules. These are   features carried over from the original <ProductName>Postgres</ProductName>  query   language,  <ProductName>PostQuel</ProductName>.  This section provides an overview   of how to use <ProductName>Postgres</ProductName>   <Acronym>SQL</Acronym>  to  perform  simple  operations.   This manual is only intended to give you an idea of our   flavor of <Acronym>SQL</Acronym> and is in no way a complete  tutorial  on   <Acronym>SQL</Acronym>.  Numerous  books  have  been  written  on   <Acronym>SQL</Acronym>, including<!--<XRef LinkEnd="MELT93"> and <XRef LinkEnd="DATE97">.-->[MELT93] and [DATE97].   You should be  aware  that  some language features    are extensions to the <Acronym>ANSI</Acronym> standard.  </Para>  <Sect1>   <Title>Interactive Monitor</Title>   <Para>    In the examples that follow, we assume  that  you  have    created  the mydb database as described in the previous    subsection and have started <Application>psql</Application>.    Examples  in  this  manual  can  also   be   found   in    <FileName>/usr/local/pgsql/src/tutorial/</FileName>.    Refer   to   the    <FileName>README</FileName> file in that directory for how to use them.   To    start the tutorial, do the following:    <ProgramListing>% cd /usr/local/pgsql/src/tutorial% psql -s mydbWelcome to the POSTGRESQL interactive sql monitor:  Please read the file COPYRIGHT for copyright terms of POSTGRESQL   type \? for help on slash commands   type \q to quit   type \g or terminate with semicolon to execute query You are currently connected to the database: postgresmydb=> \i basics.sql    </ProgramListing>   </Para>   <Para>    The  <Literal>\i</Literal>  command  read  in  queries  from the specified    files. The <Literal>-s</Literal> option puts you in single step mode which    pauses  before  sending a query to the backend. Queries    in this section are in the file <FileName>basics.sql</FileName>.   </Para>   <Para>    <Application>psql</Application>    has a variety of <Literal>\d</Literal> commands for showing system information.    Consult these commands for more details;    for a listing, type <Literal>\?</Literal> at the <Application>psql</Application> prompt.   </Para>  </sect1>  <Sect1>   <Title>Concepts</Title>   <Para>    The fundamental notion in <ProductName>Postgres</ProductName> is that of a  class,    which  is a named collection of object instances.  Each    instance has the same collection of  named  attributes,    and each attribute is of a specific type.  Furthermore,    each instance has a permanent <FirstTerm>object identifier</FirstTerm>    (<Acronym>OID</Acronym>)    that  is  unique  throughout the installation.  Because    <Acronym>SQL</Acronym> syntax refers to tables,  we  will use  the  terms    <FirstTerm>table</FirstTerm> and <FirstTerm>class</FirstTerm> interchangeably.    Likewise, an <Acronym>SQL</Acronym> <FirstTerm>row</FirstTerm> is an    <FirstTerm>instance</FirstTerm> and <Acronym>SQL</Acronym> <FirstTerm>columns</FirstTerm>    are <FirstTerm>attributes</FirstTerm>.    As  previously  discussed,  classes  are  grouped  into    databases,  and  a collection of databases managed by a    single <Application>postmaster</Application> process constitutes  an  installation    or site.   </Para>  </sect1>  <Sect1>   <Title>Creating a New Class</Title>   <Para>    You  can  create  a  new  class by specifying the class    name, along with all attribute names and their types:    <ProgramListing>CREATE TABLE weather (    city            varchar(80),    temp_lo         int,           -- low temperature    temp_hi         int,           -- high temperature    prcp            real,          -- precipitation    date            date);    </ProgramListing>   </para>   <Para>    Note that both keywords and identifiers are case-insensitive; identifiers can become    case-sensitive by surrounding them with double-quotes as allowed    by <Acronym>SQL92</Acronym>.    <ProductName>Postgres</ProductName>  <Acronym>SQL</Acronym> supports the usual    <Acronym>SQL</Acronym> types <Type>int</Type>,    <Type>float</Type>,  <Type>real</Type>,  <Type>smallint</Type>,  <Type>char(N)</Type>,      <Type>varchar(N)</Type>,  <Type>date</Type>, <Type>time</Type>,    and <Type>timestamp</Type>, as well as other types of general utility and    a rich set of geometric types.  As we will     see later, <ProductName>Postgres</ProductName> can be customized  with  an      arbitrary  number  of    user-defined  data types.  Consequently, type names are    not syntactical keywords, except where required to support special    cases in the <Acronym>SQL92</Acronym> standard.    So far, the <ProductName>Postgres</ProductName> create command    looks exactly  like    the  command  used  to  create a table in a traditional    relational system.  However, we will presently see that    classes  have  properties  that  are  extensions of the    relational model.   </Para>  </sect1>  <Sect1>   <Title>Populating a Class with Instances</Title>   <Para>    The <Command>insert</Command> statement is used to populate a  class  with    instances:    <ProgramListing>INSERT INTO weather    VALUES ('San Francisco', 46, 50, 0.25, '11/27/1994')    </ProgramListing>   </Para>   <Para>    You can also use the <Command>copy</Command> command to perform load large    amounts of data from flat (<Acronym>ASCII</Acronym>) files.    This is usually faster because the data is read (or written) as a single atomic    transaction directly to or from the target table. An example would be:    <ProgramListing>COPY INTO weather FROM '/home/user/weather.txt'    USING DELIMITERS '|';    </ProgramListing>    where the path name for the source file must be available to the backend server    machine, not the client, since the backend server reads the file directly.   </para>  </sect1>  <Sect1>   <Title>Querying a Class</Title>   <Para>    The weather class can be queried with normal relational    selection  and projection queries.  A <Acronym>SQL</Acronym> <Command>select</Command>     statement is used to do this.  The statement is divided into    a target list (the part that lists the attributes to be    returned) and a qualification (the part that  specifies    any  restrictions).   For  example, to retrieve all the    rows of weather, type:    <ProgramListing>SELECT * FROM WEATHER;    </ProgramListing>    and the output should be:    <ProgramListing>+--------------+---------+---------+------+------------+|city          | temp_lo | temp_hi | prcp | date       |+--------------+---------+---------+------+------------+|San Francisco | 46      | 50      | 0.25 | 11-27-1994 |+--------------+---------+---------+------+------------+|San Francisco | 43      | 57      | 0    | 11-29-1994 |+--------------+---------+---------+------+------------+|Hayward       | 37      | 54      |      | 11-29-1994 |+--------------+---------+---------+------+------------+    </ProgramListing>    You may specify any arbitrary expressions in the  target list. For example, you can do:    <ProgramListing>SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;    </ProgramListing>   </Para>   <Para>    Arbitrary  Boolean  operators    (<Command>and</Command>,  <Command>or</Command> and <Command>not</Command>) are    allowed in the qualification of any query.   For  example,    <ProgramListing>SELECT * FROM weather    WHERE city = 'San Francisco'    AND prcp > 0.0;    </programlisting>results in:    <programlisting>+--------------+---------+---------+------+------------+|city          | temp_lo | temp_hi | prcp | date       |+--------------+---------+---------+------+------------+|San Francisco | 46      | 50      | 0.25 | 11-27-1994 |+--------------+---------+---------+------+------------+    </ProgramListing>   </Para>   <Para>    As  a final note, you can specify that the results of a    select can be returned in a <FirstTerm>sorted order</FirstTerm>    or with <FirstTerm>duplicate instances</FirstTerm> removed.    <ProgramListing>SELECT DISTINCT city    FROM weather    ORDER BY city;    </ProgramListing>   </Para>  </sect1>  <Sect1>   <Title>Redirecting SELECT Queries</Title>   <Para>    Any select query can be redirected to a new class    <ProgramListing>SELECT * INTO TABLE temp FROM weather;    </ProgramListing>   </Para>   <Para>    This forms an implicit <Command>create</Command> command, creating a new    class temp with the attribute names and types specified    in  the target list of the <Command>select into</Command> command.  We can    then, of course, perform any operations on the  resulting     class that we can perform on other classes.   </Para>  </sect1>  <Sect1>   <Title>Joins Between Classes</Title>   <Para>    Thus far, our queries have only accessed one class at a    time.  Queries can access multiple classes at once,  or    access  the  same  class  in  such  a way that multiple    instances of the class are being processed at the  same    time.   A query that accesses multiple instances of the    same or different classes at one time is called a  join    query.    As an example, say we wish to find all the records that    are in the  temperature  range  of  other  records.  In    effect,  we  need  to  compare  the temp_lo and temp_hi    attributes of each EMP  instance  to  the  temp_lo  and    temp_hi  attributes of all other EMP instances.    <Note>     <Para>      This  is only a conceptual model.  The actual join may      be performed in a more efficient manner, but this is invisible to the user.     </Para>    </Note>    We can do this with the following query:    <ProgramListing>SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high,    W2.city, W2.temp_lo AS low, W2.temp_hi AS high    FROM weather W1, weather W2    WHERE W1.temp_lo < W2.temp_lo    AND W1.temp_hi > W2.temp_hi;+--------------+-----+------+---------------+-----+------+|city          | low | high | city          | low | high |+--------------+-----+------+---------------+-----+------+|San Francisco | 43  | 57   | San Francisco | 46  | 50   |+--------------+-----+------+---------------+-----+------+|San Francisco | 37  | 54   | San Francisco | 46  | 50   |+--------------+-----+------+---------------+-----+------+    </ProgramListing>         <Note>     <Para>      The semantics of such a join are       that the qualification      is a truth expression defined for the Cartesian  product  of      the  classes indicated in the query.  For those instances in      the Cartesian product for which the qualification  is  true,      <ProductName>Postgres</ProductName>  computes  and  returns the      values specified in the target list.        <ProductName>Postgres</ProductName> <Acronym>SQL</Acronym>      does not assign  any  meaning  to      duplicate values in such expressions.       This means that <ProductName>Postgres</ProductName>       sometimes recomputes the same target list several times;      this frequently happens when Boolean expressions are connected       with an "or".  To remove such duplicates, you must  use      the <Command>select distinct</Command> statement.     </Para>    </Note>   </para>   <Para>    In this case, both W1 and  W2  are  surrogates for  an    instance  of the class weather, and both range over all    instances of the class.  (In the  terminology  of  most    database  systems,  W1 and W2 are known as <FirstTerm>range variables</FirstTerm>.)      A query can contain an  arbitrary  number  of    class names and surrogates.   </Para>  </sect1>  <Sect1>   <Title>Updates</Title>   <Para>    You can update existing instances using the update command.     Suppose you discover the temperature readings are    all  off  by 2 degrees as of Nov 28, you may update the    data as follow:    <ProgramListing>UPDATE weather    SET temp_hi = temp_hi - 2,  temp_lo = temp_lo - 2    WHERE date > '11/28/1994';    </ProgramListing>   </Para>  </sect1>  <Sect1>   <Title>Deletions</Title>   <Para>    Deletions are performed using the <Command>delete</Command> command:    <ProgramListing>DELETE FROM weather WHERE city = 'Hayward';    </ProgramListing>    All weather recording belongs to Hayward is removed.    One should be wary of queries of the form    <ProgramListing>DELETE FROM classname;    </ProgramListing>    Without a qualification, <Command>delete</Command> will simply    remove  all  instances  of  the given class, leaving it    empty.  The system will not request confirmation before    doing this.   </Para>  </sect1>  <Sect1>   <Title>Using Aggregate Functions</Title>   <Para>    Like  most  other  query  languages,     <ProductName>PostgreSQL</ProductName> supports    aggregate functions.    The current  implementation  of    <ProductName>Postgres</ProductName> aggregate functions have some limitations.    Specifically, while there  are  aggregates  to  compute    such  functions as the <Function>count</Function>, <Function>sum</Function>,    <Function>avg</Function> (average), <Function>max</Function> (maximum) and    <Function>min</Function> (minimum) over a set of instances,  aggregates  can  only    appear  in  the  target  list of a query and not directly in the    qualification (the where clause). As an example,    <ProgramListing>SELECT max(temp_lo) FROM weather;    </ProgramListing>    is allowed, while    <ProgramListing>SELECT city FROM weather WHERE temp_lo = max(temp_lo);    </ProgramListing>    is not. However, as is often the case the query can be restated to accomplish     the intended result; here by using a <FirstTerm>subselect</FirstTerm>:    <ProgramListing>SELECT city FROM weather WHERE temp_lo = (SELECT max(temp_lo) FROM weather);    </ProgramListing>   </Para>   <Para>    Aggregates may also have <FirstTerm>group by</FirstTerm> clauses:    <ProgramListing>SELECT city, max(temp_lo)    FROM weather    GROUP BY city;    </ProgramListing>   </Para>  </sect1> </Chapter><!-- Keep this comment at the end of the fileLocal variables:mode: sgmlsgml-omittag:nilsgml-shorttag:tsgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:1sgml-indent-data:tsgml-parent-document:nilsgml-default-dtd-file:"./reference.ced"sgml-exposed-tags:nilsgml-local-catalogs:"/usr/lib/sgml/CATALOG"sgml-local-ecat-files:nilEnd:-->

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲gay无套男同| 亚洲激情中文1区| 日韩精品成人一区二区在线| 色噜噜久久综合| 亚洲视频中文字幕| www.亚洲国产| 亚洲欧洲日韩在线| 成人av在线网| 亚洲免费观看高清完整版在线观看熊| 不卡一区二区在线| 国产精品久99| 91蝌蚪porny九色| 爽好久久久欧美精品| 欧美va亚洲va香蕉在线| 国产成人综合在线| 自拍偷在线精品自拍偷无码专区| 午夜欧美视频在线观看| 欧美精品在线一区二区三区| 免费成人美女在线观看.| 久久一日本道色综合| 国产一区二区三区电影在线观看| 日韩欧美一级片| 在线一区二区视频| 国产99精品在线观看| 国产女人aaa级久久久级| 尤物视频一区二区| 蜜臀av亚洲一区中文字幕| 欧美日韩第一区日日骚| 成人免费视频在线观看| 国产成人综合精品三级| 国产成人福利片| 欧美一区二区三区白人| 亚洲视频精选在线| 成人一区二区三区视频在线观看| 欧美大黄免费观看| 日韩毛片精品高清免费| 欧美老肥妇做.爰bbww| 亚洲天堂a在线| 国产不卡视频一区| 国产精品美女久久久久高潮| 高清在线成人网| 国产精品高潮呻吟久久| 欧美一区二区精品久久911| 日韩不卡一区二区三区| 欧美日韩成人在线一区| 粉嫩在线一区二区三区视频| 蜜臀精品一区二区三区在线观看 | 麻豆久久一区二区| 中文字幕在线视频一区| 欧美三级电影网| 国产一区二区三区在线观看精品| 日韩和欧美一区二区三区| 国产精品欧美久久久久无广告 | 国产超碰在线一区| 不卡的av网站| 国产91色综合久久免费分享| 国产91精品欧美| 白白色 亚洲乱淫| 欧美在线视频不卡| 91福利在线看| 欧美丝袜第三区| 91精品福利在线| 欧美一区二区视频观看视频| 91精品国产一区二区人妖| 懂色av一区二区三区蜜臀| 不卡的av在线| 国产在线一区二区综合免费视频| 天天亚洲美女在线视频| 99视频精品免费视频| 国产天堂亚洲国产碰碰| 久久国内精品视频| 精品中文字幕一区二区| 国产精品一区二区在线看| 波多野结衣中文字幕一区二区三区 | 免费精品视频在线| 丰满少妇久久久久久久| 欧美视频一区二区| 久久婷婷久久一区二区三区| 亚洲视频在线一区| 久久精品99国产精品| 国产999精品久久| 欧美日韩午夜影院| 亚洲国产精品成人综合 | 97se亚洲国产综合自在线不卡| 欧美三级电影精品| 亚洲精品日产精品乱码不卡| 国内精品嫩模私拍在线| 欧美亚洲丝袜传媒另类| 国产精品丝袜一区| 国产综合一区二区| 日韩丝袜美女视频| 日韩黄色免费电影| 欧美军同video69gay| 亚洲欧美怡红院| 成人高清av在线| 精品福利av导航| 国产在线精品免费av| 日韩三级免费观看| 亚洲gay无套男同| 正在播放一区二区| 日本亚洲免费观看| 日韩一区二区三区av| 久久成人18免费观看| 欧美一区中文字幕| 美国十次综合导航| 久久免费看少妇高潮| 国产91色综合久久免费分享| 欧美激情一区二区三区全黄| 丰满亚洲少妇av| 亚洲精品写真福利| 欧美日韩免费观看一区二区三区| 亚洲免费在线视频一区 二区| 91成人在线精品| 青青草原综合久久大伊人精品| 日韩视频123| 99re在线精品| 日韩成人伦理电影在线观看| 欧美一区二区免费观在线| 国产一区二区不卡老阿姨| 亚洲欧美一区二区三区极速播放 | 国产精品一二三| 一区二区三区在线视频播放| 欧美一区二区视频免费观看| 国产成人午夜片在线观看高清观看 | 国产自产高清不卡| 亚洲婷婷综合久久一本伊一区| 欧美夫妻性生活| voyeur盗摄精品| 97精品久久久午夜一区二区三区| 国产精品乱码人人做人人爱| 欧美肥妇毛茸茸| 色综合久久99| 成人激情小说乱人伦| 亚洲国产一区二区三区| 国产亚洲制服色| 欧美一区二区精品在线| 在线观看av一区二区| 国产精品996| 经典一区二区三区| 蜜桃av噜噜一区二区三区小说| 一区二区三区日韩精品| 国产精品美女久久福利网站| 精品成人a区在线观看| 欧美日韩www| 欧美精品日韩精品| 欧美日韩精品三区| 9191久久久久久久久久久| 91高清视频在线| 欧美日韩一区视频| 欧美精品免费视频| 555夜色666亚洲国产免| 欧美性猛片aaaaaaa做受| 91福利视频在线| 欧美日本视频在线| 精品国产区一区| 国产欧美va欧美不卡在线| 久久久精品中文字幕麻豆发布| 国产亚洲1区2区3区| 亚洲精品高清在线| 亚洲午夜免费视频| 麻豆视频一区二区| 成人黄色电影在线 | 久久久精品中文字幕麻豆发布| 精品国产免费人成电影在线观看四季| 欧美二区乱c少妇| 久久久99免费| 亚洲成人动漫一区| 国产精品 欧美精品| 欧美一区二区三区在| 精品三级av在线| 亚洲视频在线一区二区| 蜜臀久久99精品久久久久宅男| 国产美女精品一区二区三区| 色综合天天视频在线观看| 91精品婷婷国产综合久久竹菊| 国产欧美日韩另类一区| 日韩精品久久久久久| 成av人片一区二区| 欧美xxx久久| 香蕉av福利精品导航| 97久久精品人人做人人爽50路| 欧美高清激情brazzers| 国产精品伦理在线| 国产精品亚洲专一区二区三区| 欧美日韩视频在线一区二区| 亚洲欧美一区二区在线观看| 国产一区中文字幕| 日韩视频免费观看高清完整版 | 欧美经典一区二区| 奇米四色…亚洲| 欧美日韩久久久| 亚洲国产视频一区二区| 色综合网站在线| 一区二区三区国产豹纹内裤在线| 精品成人a区在线观看| 久久精品国产秦先生| 69堂国产成人免费视频| 日本成人在线看| 日韩视频免费观看高清在线视频| 日韩电影在线一区二区三区|