• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: help needed with query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help needed with query


  • Subject: Re: help needed with query
  • From: "Daniele Corti" <email@hidden>
  • Date: Mon, 4 Feb 2008 15:08:02 +0100



2008/2/4, Theodore Petrosky <email@hidden>:
First, most of my experience is with cocoa. I could
write any query I wanted even across relationships. I
am having a problem with relationship in WO.

I am starting out with a new simple setup. My db is
normalized like this

table names:
firstname text
lastname text
nameid (serial)

namesbusinessmeta:
iscurrent bool  default true
phonenumber text
extension text
nbmid
namesFKid foreign key to names

I have a trigger and function on the db that creates a
new insert into namesbusinessmeta with the referenced
foreign key on insert into the names table.

This works fine.

but now I want to query from my WO app.
select * from names where nameid in (select namesFKid
from namesbusinessmeta where iscurrent = true) order
by lastname;

I am lost.... I want an array of current employees
where the iscurrent  bool is in relationship table.

Maybe I am barking up the wrong tree......

Wait... how do you make the queries? EOKeyValueQualifier?

Anycase, you should have a query like (using sql92),

SELECT * FROM names AS t1, namesbusinessmeta AS t2 WHERE t1.nameid = t2.namesFKid AND t2.iscurrent = TRUE;



Ted








      ____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)



--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden

--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS

--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: help needed with query
      • From: Theodore Petrosky <email@hidden>
References: 
 >help needed with query (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: help needed with query
  • Next by Date: Re: help needed with query
  • Previous by thread: help needed with query
  • Next by thread: Re: help needed with query
  • Index(es):
    • Date
    • Thread