Click here to Skip to main content
15,891,745 members
Home / Discussions / Database
   

Database

 
GeneralRe: Procedure with Multiple Update Problem Pin
Vimalsoft(Pty) Ltd16-Jan-08 0:28
professionalVimalsoft(Pty) Ltd16-Jan-08 0:28 
GeneralHelp me with SQL Query Pin
Vimalsoft(Pty) Ltd15-Jan-08 21:59
professionalVimalsoft(Pty) Ltd15-Jan-08 21:59 
GeneralCommand object use to add data to a database Pin
CodingLover15-Jan-08 18:28
CodingLover15-Jan-08 18:28 
GeneralRe: Command object use to add data to a database Pin
CodingLover15-Jan-08 19:12
CodingLover15-Jan-08 19:12 
QuestionWhat is 'IsMSShipped' ?? Pin
imsathy15-Jan-08 16:51
imsathy15-Jan-08 16:51 
GeneralRe: What is 'IsMSShipped' ?? Pin
Kishore.P15-Jan-08 18:02
Kishore.P15-Jan-08 18:02 
GeneralCreating a View Pin
AAGTHosting15-Jan-08 7:37
AAGTHosting15-Jan-08 7:37 
GeneralRe: Creating a View Pin
Colin Angus Mackay15-Jan-08 9:58
Colin Angus Mackay15-Jan-08 9:58 
AAGTHosting wrote:
cast(getdate() as datetime)


First there is no need to do this. If you had read the documentation for GETDATE()[^] you would have seen that GETDATE() returns a DATETIME already.


AAGTHosting wrote:
In this view I need to show how many students exist for each teach_id and how many lessons exist for each teach_id.


It would seem to me, therefore, that tbl_teachers and tbl_lessons is superflous in this query. You are only querying information in the tbl_lessons table.

SELECT 
       l.teach_id, 
       COUNT(l.stud_id), 
       COUNT(l.less_id) 
FROM 
     tbl_lessons l
WHERE 
      l.less_start_date < GETDATE()
AND   l.less_end_date > GETDATE()
GROUP BY l.teach_id;



GeneralRe: Creating a View Pin
AAGTHosting15-Jan-08 20:16
AAGTHosting15-Jan-08 20:16 
QuestionPerformance question Pin
Kosta Cherry15-Jan-08 7:35
Kosta Cherry15-Jan-08 7:35 
GeneralRe: Performance question Pin
Colin Angus Mackay15-Jan-08 9:49
Colin Angus Mackay15-Jan-08 9:49 
GeneralRe: Performance question Pin
Kosta Cherry15-Jan-08 13:48
Kosta Cherry15-Jan-08 13:48 
GeneralRe: Performance question Pin
Colin Angus Mackay15-Jan-08 14:19
Colin Angus Mackay15-Jan-08 14:19 
GeneralRe: Performance question Pin
Paul Conrad19-Jan-08 7:07
professionalPaul Conrad19-Jan-08 7:07 
Generalcreating table adapter queries using code Pin
Cory Kimble15-Jan-08 7:10
Cory Kimble15-Jan-08 7:10 
GeneralRe: creating table adapter queries using code Pin
Kishore.P15-Jan-08 18:22
Kishore.P15-Jan-08 18:22 
GeneralRe: creating table adapter queries using code Pin
Cory Kimble16-Jan-08 4:00
Cory Kimble16-Jan-08 4:00 
GeneralPad Left Access SQL Pin
Kschuler15-Jan-08 3:37
Kschuler15-Jan-08 3:37 
GeneralRe: Pad Left Access SQL Pin
andyharman15-Jan-08 4:00
professionalandyharman15-Jan-08 4:00 
GeneralRe: Pad Left Access SQL Pin
Kschuler15-Jan-08 4:12
Kschuler15-Jan-08 4:12 
GeneralRe: Pad Left Access SQL Pin
GuyThiebaut15-Jan-08 10:33
professionalGuyThiebaut15-Jan-08 10:33 
QuestionHow to get the PK value within an update trigger Pin
ScottM115-Jan-08 0:45
ScottM115-Jan-08 0:45 
GeneralRe: How to get the PK value within an update trigger Pin
Pete O'Hanlon15-Jan-08 1:36
mvePete O'Hanlon15-Jan-08 1:36 
GeneralRe: How to get the PK value within an update trigger Pin
ScottM117-Jan-08 1:22
ScottM117-Jan-08 1:22 
GeneralChange destination column names in Snapshot Replication Pin
BillyGoatGruff14-Jan-08 5:58
BillyGoatGruff14-Jan-08 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.