Re: need help with subselect workaround

2003-06-22 Thread Sheryl Canter
ations.com - Original Message - From: "Sheryl Canter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, June 22, 2003 2:46 PM Subject: need help with subselect workaround This is a reprise of a question I asked some months ago. Bruce Feist and Tore Bostrup g

need help with subselect workaround

2003-06-22 Thread Sheryl Canter
This is a reprise of a question I asked some months ago. Bruce Feist and Tore Bostrup gave me some untested code to try. I've only now been able to try it, and it's not quite working right. Here's a recap of the problem I'm trying to solve: My Web host is running MySQL 3.23, which doesn't suppor

Re: subselect workaround help?

2003-01-08 Thread Scott Pippin
>Student | Class >-- >Steve Lefevre | Math101 >Stacy Adams | Intro to SQL >Something like >SELECT Student.Name, Classes.Name FROM Students, Classes WHERE >Students.StudentID = " . $ID . " AND Classes.Name IN ( SELECT Classes.Name >FROM Classes WHERE ClassID = Students.Clas

Re: subselect workaround help?

2003-01-08 Thread Rodney Broom
From: Lefevre, Steven <[EMAIL PROTECTED]> > ...I think I need a subselect... It's rare that a sub-select is actually ~needed~, but it does happen. You can almost always get around it with a JOIN of some sort. > Final result should look like > Student | Class > -- > St

RE: subselect workaround help?

2003-01-08 Thread Joe Stump
AS R WHERE R.StudentID='364326' AND R.ClassID=C.ClassID --Joe -- Joe Stump <[EMAIL PROTECTED]> http://www.joestump.net -Original Message- From: Lefevre, Steven [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 8:22 AM To: [EMAIL PROTECTED] Subject: subselect wo

RE: subselect workaround help?

2003-01-08 Thread Alexander M. Turek
-Original Message- From: Lefevre, Steven [mailto:[EMAIL PROTECTED]] > > Hey folks- > > 'nother question. > I'm not an SQL expert, and I think I need a subselect, which > means I need a workaround on MySQL 3.23 or whatever version it is. > > Here's the tables I have, with the relevant column

subselect workaround help?

2003-01-08 Thread Lefevre, Steven
Hey folks- 'nother question. I'm not an SQL expert, and I think I need a subselect, which means I need a workaround on MySQL 3.23 or whatever version it is. Here's the tables I have, with the relevant columns: Students - Name - StudentID (PK) - ClassID Classes - ClassID (PK) - Name Each

re: Re: Subselect workaround

2002-12-10 Thread Egor Egorov
On Tuesday 10 December 2002 07:48, Amittai Aviram wrote: > Sorry! I meant UPDATE, not INSERT! > > UPDATE administrators SET id = > (SELECT id FROM faculty > WHERE lastName = "Jones") > WHERE ordr = 1; You can use multi-tables updates from 4.0.2 In earlier versions use programming languages.

Re: Subselect workaround

2002-12-09 Thread Amittai Aviram
OOPS! Please note correction below! > Here is what I would want to do: > > INSERT INTO administrators (id) values > (SELECT id FROM faculty > WHERE lastName = "Jones") > WHERE ordr = 1; Sorry! I meant UPDATE, not INSERT! UPDATE administrators SET id = (SELECT id FROM faculty WHERE lastName =

Subselect workaround

2002-12-09 Thread Amittai Aviram
Scenario: Databases to list names, titles, contact information, and other professional stuff about faculty members, administrators, and staff in a university department, used (among other things) as a backend to a series of Web pages with listings. I had had three tables: faculty, administration

Re: SubSelect Workaround

2002-01-04 Thread Mr. psm996
> >database,sql,query,table >Can someone please tell me why this won't work. > >if (defined($res)){ > my $stmt = qq{select distinct symbol from portfolio where $res}; > my $sth = $dbh->prepare($stmt); > $sth->execute(); > > my $portsymbols = ""; > > while ($sth->fetchrow) { > $portsymb

Re: SubSelect Workaround help

2002-01-02 Thread Anvar Hussain K.M.
Hi Paul, There is no direct way to make a string by concatinating strings of different columns. But your problem can be solved in a different way. select distinct p.symbol, i.name from portfolio p, portfolio pp, stockinfo i where pp.type = '401k' AND pp.owner = 'jim' and p.symbol = i.symbol a

RE: SubSelect Workaround help

2002-01-02 Thread Haapanen, Tom
com/ -Original Message- From: Mr. psm996 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 02 January, 2002 09:30 To: [EMAIL PROTECTED] Subject: SubSelect Workaround help How would one load the results of the following query into a one line comma separated list so that it could be then include

SubSelect Workaround help

2002-01-02 Thread Mr. psm996
How would one load the results of the following query into a one line comma separated list so that it could be then included with an IN expr to get around the lack of subselect in MySQL select distinct symbol from portfolio where type='401k' AND owner='jim' select distinct p.symbol, i.name f