Re: [SQL] How can I quit this: "Unique " to my table?

2003-04-01 Thread Achilleus Mantzios
On Tue, 1 Apr 2003, Luis Mix wrote:

> Hello pgsql-sql,
> 
>   When my table was create I wrote this:
> 
>   MyDatabase=# create table b_prestamo(no_inventa char(16) unique not
>   null, cve_area char(10), date1 date);
>   I need now that my table can accept repeated records, but not Null.
>   How can I do that?
>   SomeBody can help me please?
>   My table has information at the moment,what can I do for maintain
>   it?

drop index b_prestamo_no_inventa_idx;

>   
>   
> 
> 

-- 
==
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:+30-210-8981112
fax:+30-210-8981877
email:  [EMAIL PROTECTED]
[EMAIL PROTECTED]


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] Rows as Columns

2003-04-01 Thread chester c young
This is obtuse, but it would work:  Have a function that would
dynamically build a view that has each of your type names as a column
name.  It could be triggered by any changes to the types table.  The
data table would be a left joined onto the customer table for each
column.  Then select from the view as you would any other view.

If you'd like some suggestions on the procedure, let me know.

--- James Taylor <[EMAIL PROTECTED]> wrote:
> Hi everyone, I just joined this list a few days ago...
> 
> Now, I have a question, and I'm not even sure if this is possible
> without having to make numerous statements.
> 
> Say I have two tables with the following columns and this data:
> 
> types:
> id   | name
> -
> 1| first_name
> 2| last_name
> 3| phone_number
> 
> data:
> id   | data | t_key | cust_id
> -
> 1| Sam  | 1 | 1
> 2| Smith| 2 | 1
> 3| 555-1212 | 3 | 1
> 4| John | 1 | 2
> 
> 
> Types basically describes what the column type is.  t_key references
> the
> type, cust_id is the user id.
> 
> i'd want to do something like "select t.name, d.data from types t,
> data
> d where d.cust_id = 1"
> 
> This would return something like:
> 
> name | data
> 
> first_name   | Sam
> last_name| Smith
> phone_number | 555-1212
> 
> 
> Well, I need it to somehow return that data in this format:
> 
> first_name   | last_name  | phone_number
> 
> Sam  | Smith  | 555-1212
> 
> The information in Types is not static, so I can't declare the col
> names based on what you see here.
> 
> Any suggestions on this one?


__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


[SQL] How can I quit this: "Unique " to my table?

2003-04-01 Thread Luis Mix
Hello pgsql-sql,

  When my table was create I wrote this:

  MyDatabase=# create table b_prestamo(no_inventa char(16) unique not
  null, cve_area char(10), date1 date);
  I need now that my table can accept repeated records, but not Null.
  How can I do that?
  SomeBody can help me please?
  My table has information at the moment,what can I do for maintain
  it?
  
  

-- 
Best regards,
 Luis  mailto:[EMAIL PROTECTED]


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly