From: | gongzhixiao(at)gmail(dot)com |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | I have a select statement on the issue. |
Date: | 2007-11-28 06:58:17 |
Message-ID: | fij3i8$996$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I have a select statement on the issue.
Following is the process I operate in four steps totally:
Step 1:Create Table
CREATE TABLE test
(
code character varying(32) NOT NULL,
name character varying(32) NOT NULL DEFAULT ''::character varying,
qty integer NOT NULL DEFAULT 0,
CONSTRAINT pk_test PRIMARY KEY (code)
)
Step 2:Insert Data
insert into test(code,name,qty) values('1001','1001name','qty');
insert into test(code,name,qty) values('1002','1002name','qty');
insert into test(code,name,qty) values('1003','1003name','qty');
Step 3:Select Data
select * from test
Results:
code name qty
1001 1001name 1
1002 1002name 2
1003 1003name 3
Step 4:Update Date
update test set name='1111name' where code='1002'
Results:
code name qty
1001 1001name 1
1003 1003name 3
1002 1111name 2
Question:
1. Why the default output changes after I execute the update statement?
2. Qustion, sorting as main keys when query, how to do?
Thank you.
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Bauer | 2007-11-28 07:19:22 | Re: System Load analyze |
Previous Message | Ashish Karalkar | 2007-11-28 06:05:19 | WAL Recovery |