Skip site navigation (1) Skip section navigation (2)

Re: SQL "OR" Problem - Small Update

From: <operationsengineer1(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: SQL "OR" Problem - Small Update
Date: 2005-08-26 21:46:45
Message-ID: 20050826214645.32503.qmail@web33302.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
> with the help of everyone here...  i was able to get
> this to work...
> 
> SELECT DISTINCT t_emp.emp_id, t_emp.first_name || '
> '
> || t_emp.last_name, t_pos.pos
> FROM t_emp, t_pos
> WHERE t_emp.pos_id = t_pos.pos_id
> AND (t_pos.pos = 'Assembler' 
> OR t_pos.pos = 'Quality Inspector'
> OR t_pos.pos = 'Test Technician')

...until i tried to stuff the resultset into an array.
 I received the following error.

Call to a member function on a non-object

so i ditched the DISTINCT and the results were still
as expected and i can put the resultset into an array.

the "final answer" code (for the moment, anyway -lol-)
is:

SELECT t_employee.employee_id, t_employee.first_name
|| ' ' || t_employee.last_name, t_position.position
FROM t_employee, t_position
WHERE t_employee.position_id = t_position.position_id
AND t_position.position IN ('Assembler', 'Quality
Inspector', 'Test Technician')

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

In response to

pgsql-novice by date

Next:From: Charley L. TiggsDate: 2005-08-26 22:07:17
Subject: Re: SQL safe input?
Previous:From: operationsengineer1Date: 2005-08-26 21:32:07
Subject: Re: SQL "OR" Problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group