Full Version : Wow
llamatronics >>Other Programming >>Wow


<< Prev | Next >>

LlamaTronics- 10-11-2004
SELECT emp_last_name "Last Name", emp_first_name "First Name"
FROM employee
WHERE emp_ssn IN
(SELECT work_emp_ssn
FROM assignment
WHERE work_hours > 10 AND work_pro_number IN(
SELECT pro_number
FROM project
WHERE pro_name = 'Order Entry') );

Select within a Select within a Select - wow

theplustwo- 10-11-2004
Check this out it's an awesome SQL query using the tables we made in class:

CODE
select * from assignment, bed, bed_type, contract_employee,
department, dependent, dept_locations, employee, medical_specialty,
medicine, patient, patient_note, prescription, project, room,
service, service_cat, staff, staff_medspec,
treatment, ward_dept;

LlamaTronics- 10-11-2004
Hey!!! That was kind of funny! I encourage everyone... with these tables on thier SQL server... to run this query!

dreamer- 01-01-2006
whats it do?

LlamaTronics- 01-01-2006
well... basically it is a huge query - it just keeps going, and going, and going, and going... lol

dreamer- 01-01-2006
okay

does it help in any way

and in what way?

LlamaTronics- 01-01-2006
No, it was a joke in a class - it is quite funny, but you hvae to have those tables...

dreamer- 01-01-2006
and you have to know sql

cos i have no idea what it means

lol

LlamaTronics- 01-01-2006
lol, anyways, its a very simple SQL statement... SQL is like logical engligh...

Here, I'll break it down for you:

CODE

select *

-- basically means Show all data

CODE

from assignment, bed, bed_type, contract_employee,
department, dependent, dept_locations, employee, medical_specialty,
medicine, patient, patient_note, prescription, project, room,
service, service_cat, staff, staff_medspec,
treatment, ward_dept;

-- is just a list of table to show all data from.

So - this line of SQL code would select every piece of data in all of the tables listed in the database. Some were very large tables, which is why it kept going and going and going...




Scott- 01-01-2006
its similar to doing IFs in VB only in a different language

dreamer- 01-01-2006
yeah i dont no visual basic

okay kinda makes sense now

thanx

Free Forum Hosting by Forumer.comTM!