[all departments that don’t have employees]
[PHP]Select * From dbo.Departament s
Where depID NOT IN (SELECT depID FROM dbo.Employees)
GO[/PHP]
[ all employees who don’t belong to any department]
[PHP]Select * From dbo.Employees
Where depID NOT IN (SELECT depID FROM dbo.Departament s )
GO[/PHP]
User Profile
Collapse
-
U didnt use an ALIAS "employees as emp "
[PHP]
SELECT
emp.Last_name,
emp.First_name,
departments.Dep artment_id
FROM
employees as emp
inner join departments
on (emp.Department _id = Departments.Dep artment_id)
ORDER BY 3;
[/PHP]
I gues it wos the problem.Leave a comment:
-
MSSQL: ALTER TABLE in PROCEDURE
Hi i got a problem when i try to Alter Table in the procedure. I have red that i need to place keyword IMMIDIATE but it dont work in mssql.
I need thede procedure to drop FOREIGN KEY, TRUNCATE and add FOREIGN KEY
[PHP]
-- PUBLISHERS
ALTER PROCEDURE clearPublishers
AS
BEGIN TRANSACTION
ALTER TABLE dbo.Books
DROP CONSTRAINT FK_Publishers_B ooks
TRUNCATE TABLE dbo.Publishers... -
# <- when using reference by id
. <- by class name
<- reference to tag name [div,tr,td,....]
ex:
[HTML]
<style>
// all div tags will have font size 80%;
div { font-size:80%; }
//object with id = site will have orange fonts
#site { color:orange;}
//object with class name=box will have blue backgrounds
.box { background-color:blue;...Leave a comment:
-
# <- when using reference by id
. <- by class name
ex:
[HTML]div.#site {..} for <div id="site">...</div>
div.box {...} for <div class="box">..</div>[/HTML]
or box in site :
[HTML]div.#site.box {..} for
<div id="site"><div class="box">..</div></div>[/HTML]Leave a comment:
No activity results to display
Show More
Leave a comment: