|
|
 |
Re: FN-FORUM: sql question
date posted 10th August 2003 17:56
It is MySql and Project_Id is a tinyint. Shucks. How do I get the
information from the first table where the Emploee_Id is not in the second
one then?
Thanks
Pam
----- Original Message -----
From: "David Zverina" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Sunday, August 10, 2003 6:16 PM
Subject: Re: FN-FORUM: sql question
>
> Also if you are using MySQL you can't use nested queries (unless you're
> using the alpha version of 4.1.0 and the syntax is different anyway).
> And most other database do not perform automatic string to integer
> conversion. So you may still have a problem unless project_id is a
> string.
>
> On Sun, 2003-08-10 at 17:56, PAMELA WHITTAKER wrote:
> > OOPS - I have just realised that "SELECT Employee_Id FROM
> > greensplash_employees_per_project where Project_Id = '18' " won't find
> > anything. No wonder it is failing.
> >
> > Thanks
> > Pam
> >
> >
> >
> > ----- Original Message -----
> > From: "Alan Sheppard" [EMAIL REMOVED]
> > To: [EMAIL REMOVED]
> > Sent: Sunday, August 10, 2003 5:49 PM
> > Subject: RE: FN-FORUM: sql question
> >
> >
> > >
> > > Pam
> > >
> > > Is project_id a numeric and your testing against a string '18' ?
> > >
> > > Alan S
> > >
> > > On 10 August 2003 17:42, PAMELA WHITTAKER [EMAIL REMOVED]
> > wrote:
> > > >
> > > > I am getting the following error
> > > > You have an error in your SQL syntax near 'SELECT Employee_Id FROM
> > > > greensplash_employees_per_project where Project_Id = '18' at line 1.
> > > >
> > > > I have set the sql string as follows
> > > >
> > > > $sqlstring = "SELECT Employee_Id, Employee_Forename,
Employee_Surname
> > FROM
> > > > greensplash_employees_details where Employee_Status = 'Active' AND
> > > > Employee_Id NOT IN (SELECT Employee_Id FROM
> > > > greensplash_employees_per_project where Project_Id = '" .
> > > > $row_Project_Id['Project_Id'] . "') Order By Employee_Forename";
> > > >
> > > > and echo prints out
> > > >
> > > > SELECT Employee_Id, Employee_Forename, Employee_Surname FROM
> > > > greensplash_employees_details where Employee_Status = 'Active' AND
> > > > Employee_Id NOT IN (SELECT Employee_Id FROM
> > > > greensplash_employees_per_project where Project_Id = '18') Order By
> > > > Employee_Forename
> > > >
> > >
> > >
> > >
> > > ==========
> > > fido.net are pleased to sponsor these Freelancers messages. For all
> > > your web hosting needs check out http://www.fido.net/ with hosting
> > > packages starting from just 46.95 a year including VAT.
> > > Free 0871 Fax2Email numbers also available online!
> > > http://www.fido.net/ - the internet made simple! - 0800 1072 666
> > >
> > > To advertise here: http://www.freelancers.net/advertising.html
> > >
> > >
> > ==========
> > fido.net are pleased to sponsor these Freelancers messages. For all
> > your web hosting needs check out http://www.fido.net/ with hosting
> > packages starting from just 46.95 a year including VAT.
> > Free 0871 Fax2Email numbers also available online!
> > http://www.fido.net/ - the internet made simple! - 0800 1072 666
> >
> > To advertise here: http://www.freelancers.net/advertising.html
> >
> >
> ==========
> fido.net are pleased to sponsor these Freelancers messages. For all
> your web hosting needs check out http://www.fido.net/ with hosting
> packages starting from just £46.95 a year including VAT.
> Free 0871 Fax2Email numbers also available online!
> http://www.fido.net/ - the internet made simple! - 0800 1072 666
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|