> > Now, i need to get the details of all employees who did
> > receive NONE of the salesorders. ie.. i wish to select the
> > records of table 'employee' whose 'emp_id' are not
> > there in table 'salesorder'.
> >
> > I need to accompolish in a single query!
This should work:
select e
Ari,
> I keep getting this error "You have an error in your SQL syntax near
> '' at
> line 1" when I try to run the below query. Does anyone know what I'm
> missing? Maybe some of the variables need to be in single or double
> qoutes?
> I tried a bunch of things, but no change.
The first thing y
"Alexey V. Neyman" <[EMAIL PROTECTED]> writes:
> CREATE TABLE b (
> int4 id
> CHECK (id = ANY(SELECT a.id FROM a))
> );
> ERROR: ExecEvalExpr: unknown expression type 108
More recent versions say
ERROR: Cannot use subselect in CHECK clause
It seems to me that what you really want here is
On Fri, 13 Jul 2001, Alexey V. Neyman wrote:
> Hello there!
>
> [Please Cc: me in followups.]
>
> I tried the following:
>
> CREATE TABLE a (
> int4 id
> );
> CREATE TABLE b (
> int4 id
> CHECK (id = ANY(SELECT a.id FROM a))
> );
>
> Tables are created ok, checking with '\d table' confi
Richard,
> Out of curiosity Josh, why aren't you validating in PHP? - only takes
> a
> couple of lines there.
We are. It's just that all other validation takes place inside the
PL/pgSQL functions in order to keep all the business logic in the
database. Having one form of validation in the inte
From: "Josh Berkus" <[EMAIL PROTECTED]>
> Folks,
>
> Pardon me for asking this again, but I received *no* responses last
> week.
>
> Question: Is there any function or method which will allow me, in SQL
> or PL/pgSQL, to validate dates without raising an error for invalid
> dates?
>
> Expansion:
Hi,
I keep getting this error "You have an error in your SQL syntax near '' at
line 1" when I try to run the below query. Does anyone know what I'm
missing? Maybe some of the variables need to be in single or double qoutes?
I tried a bunch of things, but no change.
tbl_all holds the foreign keys
Something like?
select employee.* from employee where
not exists (select * from salesorder where
salesorder.emp_id=employee.emp_id);
On Fri, 13 Jul 2001 [EMAIL PROTECTED] wrote:
>
>
> Hi,
>
> Consider the below...
>
> table 'employee' with unique 'emp_id',
> table 'salesorder' wi
Hi,
if you translate your (english) idea striktly to SQL, you'll make it ;-)
> Now, i need to get the details of all employees who did
> receive NONE of the salesorders. ie.. i wish to select the
> records of table 'employee' whose 'emp_id' are not
> there in table 'salesorder'.
SELECT
[EMAIL PROTECTED] writes:
> Now, i need to get the details of all employees who did
> receive NONE of the salesorders. ie.. i wish to select the
> records of table 'employee' whose 'emp_id' are not
> there in table 'salesorder'.
SELECT * FROM employee WHERE emp_id NOT IN (SELECT emp_id FROM
On Fri, 13 Jul 2001, Josh Berkus wrote:
> Folks,
>
> Pardon me for asking this again, but I received *no* responses last
> week.
>
> Question: Is there any function or method which will allow me, in SQL
> or PL/pgSQL, to validate dates without raising an error for invalid
> dates?
Not as far
James,
> However, I came to the realization that if somebody changes their
> address, I
> don't want it to be changed on previous orders. So I think i'll
> change the
> orders table to contain the actual address information and use an
> INSERT ...
> SELECT instead. That way I can be sure I have
Folks,
Pardon me for asking this again, but I received *no* responses last
week.
Question: Is there any function or method which will allow me, in SQL
or PL/pgSQL, to validate dates without raising an error for invalid
dates?
Expansion: I have a number of PL/pgSQL functions which must accept
Jul 13, 09:41 -0400, James Orr wrote:
> Thanks for all the responses! The one from Grigoriy was particularly
> interesting, I hadn't thought of that approach.
>
> However, I came to the realization that if somebody changes their address, I
> don't want it to be changed on previous orders. So I
Thanks for all the responses! The one from Grigoriy was particularly
interesting, I hadn't thought of that approach.
However, I came to the realization that if somebody changes their address, I
don't want it to be changed on previous orders. So I think i'll change the
orders table to contain th
Hello
I have a function with a field record named 'starting'.
Now I want to use starting in a query. Is it possible ?
I use it with a simple join inside the query a I got the message that
table starting is not defined !!!
Best Regards
Luis Sousa
---(end of broadcast)--
Jul 12, 16:25 -0400, James Orr wrote:
Much better will be change database structure - you have absolutely
identical tables, so is not good from normalization point of view.
Better use one table for address, and link it to one table for
"entity" - both person and company, and "entity" link to spec
17 matches
Mail list logo