Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
indervirsingh
Starting Member
3 Posts |
Posted - 2002-12-18 : 04:59:39
|
| Hi, Recently while working on some stored procedures I came on a query Delete Sch_DailyFrom Sch_Daily S Left Join Pay_Types P On S.Pay_Type_ID = P.Pay_Type_IDWhere Week_Start_Date = @ToStartDate And SSN In( Select Option_Type From Web_Control Where Web_ID = 200 And FieldName = @UserID) And (P.Allow_On_Sched = 0 Or S.Pay_Type_ID Is Null)Here Sch_Daily, Pay_Types and Web_Control are tables. What I want to know is what does the first line mean i.e "Delete Sch_Daily". What syntax is this ? Can this query be written in a simpler form ?Actually I need the MSAccess equivalent of this query as well.Any suggestions ?Regards,IVy |
|
|
Crespo24
Village Idiot
144 Posts |
Posted - 2002-12-18 : 05:25:58
|
It is deleteing rows from the table where the condition is satisfied.------------------------- |
 |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2002-12-18 : 05:38:24
|
I don't get the query!!!! Expect the UnExpected |
 |
|
|
indervirsingh
Starting Member
3 Posts |
Posted - 2002-12-18 : 05:52:18
|
Yeah well Crespo, I already knew that !! And Harshal_In I wanted to know the exact syntax of this particular query. I did not get it either !! |
 |
|
|
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2002-12-18 : 09:28:58
|
| The Syntax is Transact-SQL.This example shows the Transact-SQL extension used to delete records from a base table that is based on a join or correlated subquery. The first DELETE shows the SQL-92-compatible subquery solution, and the second DELETE shows the Transact-SQL extension. Both queries remove rows from the titleauthors table based on the titles stored in the titles table./* SQL-92-Standard subquery */USE pubsDELETE FROM titleauthorWHERE title_id IN (SELECT title_id FROM titles WHERE title LIKE '%computers%') /* Transact-SQL extension */USE pubsDELETE titleauthorFROM titleauthor INNER JOIN titles ON titleauthor.title_id = titles.title_idWHERE titles.title LIKE '%computers%'Voted best SQL forum nickname...."Tutorial-D" |
 |
|
|
indervirsingh
Starting Member
3 Posts |
Posted - 2002-12-18 : 23:47:06
|
| Thanks a lot Sitka. This pretty much clears my doubt.Regards,IVy |
 |
|
|
|
|
|