Re: [SQL] Problem with a lookup table! Please help.

2002-12-09 Thread Oliver Elphick
On Mon, 2002-12-09 at 20:58, Chris Jewell wrote: > ... > However, I now want to have a new table which converts numbers into > words. The problem is this, if I join the main table with the > "translation" lookup table, the column names for each of the four > categories in the main default to the c

Re: [SQL] ISNULL FUNCTION

2002-12-09 Thread 2000 Informática
- Original Message - From: "Héctor Iturre" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 11:30 AM Subject: [SQL] ISNULL FUNCTION > HI, >HERE IS AN ALTERNATIVE TO USE THE SQL SERVER > ISNULL() FUNCTION > > > select case when FIELD_NAME isnull then 'EXPRES

Re: [SQL] Problem with a lookup table! Please help.

2002-12-09 Thread Chris Jewell
Hi, Thanks for your reply. Table definitions are: CREATE TABLE tblantibiotics ('Antibiotic' varchar(50),'Activity_against_grampos' int,'Activity_against_gramneg' int,'Activity_against_aerobes' int,'Activity_against_anaerobes' int); CREATE TABLE efficacy ('Efficacy_code' int,'Plain_english'

Re: [SQL] Problem with a lookup table! Please help.

2002-12-09 Thread Jean-Luc Lachance
Use the AS keyword to introduce a column alias. Select thisverlongtablename.thefirstfield as title, ... from JLL Josh Berkus wrote: > > Chris, > > > In my capacity as a vet student, I'm trying to create a database of > antibiotics. The way that I have set it up so far is to have one main tab

Re: [SQL] Problem with a lookup table! Please help.

2002-12-09 Thread Josh Berkus
Chris, > In my capacity as a vet student, I'm trying to create a database of antibiotics. The way that I have set it up so far is to have one main table listing the antibiotics versus their respective efficacies against the four major groups of bacteria. Due to the way that my PHP frontend w

Re: [SQL] [OT] Inventory systems (private)

2002-12-09 Thread Troy
Ries, Sorry I missed a few days here. I was busy elsewhere. Anyway, the speed issue is fixed with indexes. Once you know the kind of queries you will be making, create an optimized index for each one of those queries. You probably want to have a separate table for storing the attribute names.

[SQL] Problem with a lookup table! Please help.

2002-12-09 Thread Chris Jewell
Hi,   In my capacity as a vet student, I'm trying to create a database of antibiotics.  The way that I have set it up so far is to have one main table listing the antibiotics versus their respective efficacies against the four major groups of bacteria.  Due to the way that my PHP frontend wo

Re: [SQL] Rules/Trigges Trade-offs

2002-12-09 Thread Josh Berkus
Ian, > Thanks! I would have, but my messages bounce from SQL, even though I am subscribed ( I get the messages, for crying out loud!) send an e-mail to [EMAIL PROTECTED] > > PS RECORD doesn't work but I think that is because I am on 7.2.1 OK. I may have tested that on 7.4 devel by acci

Re: [SQL] Rules/Trigges Trade-offs

2002-12-09 Thread Josh Berkus
Ian, You're welcome. Replying to the list for the edification of other users. -Josh > I just figgered it out. I declared the function as > > create function some_func(test) returns int ... > > where test is the name of a table. The values are passed as a tcl array. I will see if RECORD w

Re: [SQL] Rules/Trigges Trade-offs

2002-12-09 Thread Josh Berkus
Ian, > Anyway, I have a similar requirement, to intercept insert/update/delete and redirect the data if a condition is met. Right now I am trying an INSTEAD rule that puts the condtion in the WHERE of the rule definition. It seems to work OK, but if the condition has exeptions where I would

Re: [SQL] Default Permissions (repost from Novice)

2002-12-09 Thread Richard Huxton
On Monday 09 Dec 2002 6:51 am, Michael Weaver wrote: > How can I set default permissions on tables, so that I don't have to > manually set them for every table? Don't know if you got an answer in novice, but your best bet is one of the GRANT ... TO ALL type solutions mentioned in the last week or

Re: [SQL] Rules/Trigges Trade-offs

2002-12-09 Thread Jean-Luc Lachance
Josh, Thanks for the info. I need to change an insert into an update when the key already exists. I have been using a rules to test it on a small set (table) and it works. "Rules can't use indexes" just scared me. I will have to test on a larger set. Also, I had the impression that if a trigger

[SQL] Adding foreign key constraint post table creation

2002-12-09 Thread Charles Hauser
All, A couple of novice questions: I would like to modify an existing TABLE by addinga new column (FOREIGN KEY): type_id int not null, foreign key (type_id) references cvterm (cvterm_id), Will this work ( running PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96): AL

Re: [SQL] ISNULL FUNCTION

2002-12-09 Thread Ludwig Lim
--- Héctor Iturre <[EMAIL PROTECTED]> wrote: > HI, >HERE IS AN ALTERNATIVE TO USE THE SQL SERVER > ISNULL() FUNCTION > > > select case when FIELD_NAME isnull then 'EXPRESION' > else FIELD_NAME end > from calfiscal > where impuesto = 1 try using SELECT coalesce(field_name,'EXPRESSION')

[SQL] ISNULL FUNCTION

2002-12-09 Thread Héctor Iturre
HI, HERE IS AN ALTERNATIVE TO USE THE SQL SERVER ISNULL() FUNCTION select case when FIELD_NAME isnull then 'EXPRESION' else FIELD_NAME end from calfiscal where impuesto = 1 Ahora podés usar Yahoo! Messenger desde tu celular. Aprendé cómo hacerlo en Yahoo! Móvil: http://ar.mobile.yahoo.com/s

[SQL] ISNULL FUNCTION

2002-12-09 Thread Héctor Iturre
HI, HERE IS AN ALTERNATIVE TO USE THE SQL SERVER ISNULL() FUNCTION select case when FIELD_NAME isnull then 'EXPRESION' else FIELD_NAME end from calfiscal where impuesto = 1 Ahora podés usar Yahoo! Messenger desde tu celular. Aprendé cómo hacerlo en Yahoo! Móvil: http://ar.mobile.yahoo.com/s

Re: [SQL] sql

2002-12-09 Thread Richard Huxton
On Monday 09 Dec 2002 10:40 am, cristi wrote: > (I want to receive the records which are a combitation of fields of table_a > and table_b and that are not in the table_c) The following is one way. Not necessarily the most efficient, but it should be clear enough. Basically it builds the product o

[SQL] sql

2002-12-09 Thread cristi
I have 3 tables.   table_a marca 15145 1455 1333   table_b data 11-01-2002 11-02-2002   table_c marca    data 15145    11-01-2002 15145    11-02-2002 1455 11-01-2002 1333  11-01-2002 1333  11-02-2002   After interogation of the tables I need this kind of result:   marca