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

Database

 
QuestionDatagrid view Pin
hitesh.kalra29-Apr-09 21:35
hitesh.kalra29-Apr-09 21:35 
AnswerRe: Datagrid view Pin
Mycroft Holmes29-Apr-09 22:01
professionalMycroft Holmes29-Apr-09 22:01 
AnswerRe: Datagrid view Pin
saanj29-Apr-09 23:59
saanj29-Apr-09 23:59 
QuestionHow to deploy a report to the client machine server? Pin
SIJUTHOMASP29-Apr-09 10:06
professionalSIJUTHOMASP29-Apr-09 10:06 
AnswerRe: How to deploy a report to the client machine server? Pin
saanj30-Apr-09 0:01
saanj30-Apr-09 0:01 
Question[Message Deleted] Pin
Member 195906229-Apr-09 2:52
Member 195906229-Apr-09 2:52 
AnswerRe: ADO.NET DBDataReader Pin
Henry Minute29-Apr-09 4:54
Henry Minute29-Apr-09 4:54 
QuestionAn SQL Statistics Pin
foryou29-Apr-09 2:12
foryou29-Apr-09 2:12 
Hi!
I work on an intranet site of a university(sqlserver2005) and I need to do statistics
for example I need to count the students new in the semester 2 for each city:
Here is the SQL query that selects the new students in semester 2:
WITH r1 AS (SELECT     CAPITALISE_SEMESTRE_1.NUM_INSCRIPTION, CAPITALISE_SEMESTRE_1.CODE_SEMESTRE  , CAPITALISE_SEMESTRE_1.ann_uni, SEMESTRE_1.LIBELLE_SEMESTRE_AR, 
                                                  TYPE_RELATION_SEMESTRE_1.LIBELLE_TYPE_RELATION_SEMESTRE
                         FROM         CAPITALISE_SEMESTRE AS CAPITALISE_SEMESTRE_1 INNER JOIN
                                                  SEMESTRE AS SEMESTRE_1 ON CAPITALISE_SEMESTRE_1.CODE_SEMESTRE = SEMESTRE_1.CODE_SEMESTRE INNER JOIN
                                                  TYPE_RELATION_SEMESTRE AS TYPE_RELATION_SEMESTRE_1 ON 
                                                  CAPITALISE_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE = TYPE_RELATION_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE
                           WHERE     (CAPITALISE_SEMESTRE_1.CODE_TYPE_RELATION_SEMESTRE = 4) AND (CAPITALISE_SEMESTRE_1.CODE_SEMESTRE = 2)), 
r2 AS
    (SELECT     CAPITALISE_SEMESTRE.NUM_INSCRIPTION AS Expr1, CAPITALISE_SEMESTRE.CODE_SEMESTRE AS Expr2, 
                             SEMESTRE.LIBELLE_SEMESTRE_AR AS Expr3,CAPITALISE_SEMESTRE.ann_uni AS Expr4
      FROM          CAPITALISE_SEMESTRE AS CAPITALISE_SEMESTRE INNER JOIN
                             SEMESTRE AS SEMESTRE ON CAPITALISE_SEMESTRE.CODE_SEMESTRE = SEMESTRE.CODE_SEMESTRE INNER JOIN
                             TYPE_RELATION_SEMESTRE AS TYPE_RELATION_SEMESTRE ON 
                             CAPITALISE_SEMESTRE.CODE_TYPE_RELATION_SEMESTRE = TYPE_RELATION_SEMESTRE.CODE_TYPE_RELATION_SEMESTRE
      WHERE      (CAPITALISE_SEMESTRE.ann_uni = @ann_uni) AND (CAPITALISE_SEMESTRE.CODE_SEMESTRE = 1))
    SELECT     r1_1.NUM_INSCRIPTION,  r1_1.ann_uni,r1_1.CODE_SEMESTRE, r1_1.LIBELLE_SEMESTRE_AR, r1_1.LIBELLE_TYPE_RELATION_SEMESTRE, r2_1.Expr1, 
                            r2_1.Expr2, r2_1.Expr3, r2_1.Expr4
     FROM         r1 AS r1_1 INNER JOIN
                            r2 AS r2_1 ON r1_1.NUM_INSCRIPTION = r2_1.Expr1


but I do not know how to calculate the number for each city:

Number of sudent new in semester2------------City
12222---------------------------------city1
123----------------------------------city2
Thanks.
AnswerRe: An SQL Statistics Pin
Mycroft Holmes29-Apr-09 2:26
professionalMycroft Holmes29-Apr-09 2:26 
GeneralRe: An SQL Statistics Pin
foryou29-Apr-09 3:53
foryou29-Apr-09 3:53 
QuestionProblem in Read data from Excel sheet Pin
Bragadeeshwaran28-Apr-09 21:22
Bragadeeshwaran28-Apr-09 21:22 
QuestionDatabase Duplication Pin
Leo Smith28-Apr-09 6:05
Leo Smith28-Apr-09 6:05 
AnswerRe: Database Duplication Pin
David Mujica28-Apr-09 7:51
David Mujica28-Apr-09 7:51 
GeneralRe: Database Duplication Pin
Leo Smith28-Apr-09 8:19
Leo Smith28-Apr-09 8:19 
QuestionUsing SQL Server 2008 Pin
musefan28-Apr-09 1:30
musefan28-Apr-09 1:30 
AnswerRe: Using SQL Server 2008 Pin
Rob Smiley28-Apr-09 2:04
Rob Smiley28-Apr-09 2:04 
GeneralRe: Using SQL Server 2008 Pin
musefan28-Apr-09 2:13
musefan28-Apr-09 2:13 
Questionwhat is the best method to install SQL server Express 2005 programmatically Pin
sunil goyalG28-Apr-09 0:44
sunil goyalG28-Apr-09 0:44 
QuestionOracle On Vista?? Pin
Muammar©27-Apr-09 23:06
Muammar©27-Apr-09 23:06 
AnswerRe: Oracle On Vista?? Pin
RussellT5-Jun-09 9:24
professionalRussellT5-Jun-09 9:24 
QuestionCreate backup of Database of SQL server from Client and server Pin
sunil goyalG27-Apr-09 21:47
sunil goyalG27-Apr-09 21:47 
AnswerRe: Create backup of Database of SQL server from Client and server Pin
scottgp28-Apr-09 0:32
professionalscottgp28-Apr-09 0:32 
GeneralRe: Create backup of Database of SQL server from Client and server Pin
sunil goyalG28-Apr-09 0:46
sunil goyalG28-Apr-09 0:46 
GeneralRe: Create backup of Database of SQL server from Client and server Pin
scottgp28-Apr-09 1:03
professionalscottgp28-Apr-09 1:03 
GeneralRe: Create backup of Database of SQL server from Client and server Pin
sunil goyalG28-Apr-09 1:57
sunil goyalG28-Apr-09 1:57 

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.