den: (Default)
[personal profile] den
bloody SQL assignment is killing me.

"List all data from the Person table who are niether staff nor patients."

fucked if I know.

Why does

WHERE person.person_id = staff.person_id
AND person.person_id = admission.patient_id


work and

WHERE person.person_id <> staff.person_id
AND person.person_id <> admission.patient_id


not?

Date: 30 Mar 2002 20:29 (UTC)
From: [identity profile] mmmetta.livejournal.com
select * from persons where type not in ("staff","patients");

that's more or less what it should be, but 'type' would be the field you're using for the staff/patient flag. lemme know if that works, it's just off the top of my head.

Date: 30 Mar 2002 20:31 (UTC)
From: [identity profile] moonrose.livejournal.com
great minds think alike ;)

Date: 30 Mar 2002 20:35 (UTC)
From: [identity profile] mmmetta.livejournal.com
heh, that one was a no-brainer. i'm just gonna have to hide later on when den gets to the more complex stuff. i didn't go much past first semester database stuff, and since then it's been real simple stuff for me ;-)

Date: 30 Mar 2002 20:45 (UTC)
From: [identity profile] dewhitton.livejournal.com
Access is asking for a type parameter entry.

Date: 30 Mar 2002 20:47 (UTC)
From: [identity profile] dewhitton.livejournal.com
we haven't covered TYPE in the course, so I suppose technically I shouldn't use it.

jeez I hate programming of any sorts

Date: 30 Mar 2002 20:52 (UTC)
From: [identity profile] mmmetta.livejournal.com
it's always a toss-up as to whether or not to use stuff they haven't taught you... i usually go for the 'right' answer (the one i feel is the best way to do it) rather than putting up with what they teach you.

i guess that's why i never really stick with my comp sci courses, they just frustrate me too much.


Profile

den: (Default)
den

April 2023

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 31 December 2025 00:09
Powered by Dreamwidth Studios