Re: join tables
Posted in 1994
domen@taz.Trenton.EDU (Daniel Domen) writes:
>Right now, I'm using Informix and there is little documentation. I currently attending Trenton State College. Informix was recently bought and my class learnshow to do things a day or two after the teacher knows. I was wondering how to join multiple tables. for example:
>
>I have a table of student information (social sec. #, name, etc..)
>I also have a table of registered classes(student SSN, class number, section #, etc...)
>
>I want to join the two social security number columns.
OK, I'll help this time, but this is definately an "RTFM" issue, so I
suggest you get a manual or two (they can be ordered just like the
software can).
You have tables:
student
...
ssn
...
register
...
ssn
...
SELECT student.column, student.column, ...,
register.column, register.column, ...
FROM student, register
WHERE resigster.ssn = student.ssn...
ORDER BY ...
Note that here is no comma after the last column listed in the SELECT.
>
>Right now, my teacher and the people working on getting informix incorporated into the classroom are concentrating on running informix from the shell level
>
> how to do this?
Accessing the dbaccess menu (which comes with the database engine)
from shell, you need some environment variables set:
INFORMIXDIR: set to the full path name where you installed the products
(usually /usr/informix).
PATH: include $INFORMIXDIR/bin into the executable PATH.
then entering:
dbaccess
will get you to a ring menu that is pretty basic
to navigate through.
To run an SQL statement from the shell without going through
the menuing:
dbaccess database-name <<!
SELECT .... (or any other SQL statement)
!
If you understand Unix, you'll see a lot of common similarities on how
Informix statements work.
=======================================================================
Dennis J. Pimple dennisp@informix.com Opinions expressed
Senior Consultant -------------------- are mine, and do not
Informix Software Inc Voice: 303-850-0210 necessarily reflect
Denver Colorado USA Fax: 303-779-4025 those of my employer.
>
> dan domen
> domen@snuffy.trenton.edu