I am going to upgrade my database from version 4 to 5.
However I found some of my web application doesn't work on MySQL5
e.g following statement works in 4 but not 5
SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as
cat_state, c.name as cat_name, c.description as cat_desc,
I want to write a sp return paging of recordset.
CREATE PROCEDURE `sp_GetJobsDetails`(Page INT, PageSize INT)
BEGIN
DECLARE RecordBegin INT;
DECLARE tmpPageSize INT;
SET RecordBegin = Page * PageSize - PageSize;
SET tmpPageSize = PageSize + 1;
SELECT JOB_ID
I have a student Table and a SubjectGrade table
Create Table Student(
StudentID INT NOT NULL,
StudentName VARCHAR(30)
)
Create Table SubjectGrade(
StudentID INT NOT NULL,
Subject VARCHAR(30) NOT NULL,
Grade CHAR(1)
)
let's say have following record in SubjectGrade
1MathsA
1Phys
I am using mysql 4.0.25 with no subquery support : (
Jason Chan [EMAIL PROTECTED] ¦b¶l¥ó news:[EMAIL PROTECTED]
¤¤¼¶¼g...
I have a student Table and a SubjectGrade table
Create Table Student(
StudentID INT NOT NULL,
StudentName VARCHAR(30)
)
Create Table SubjectGrade(
StudentID INT NOT NULL
Jason Chan wrote:
I have a student Table and a SubjectGrade table
Create Table Student(
StudentID INT NOT NULL,
StudentName VARCHAR(30)
)
Create Table SubjectGrade(
StudentID INT NOT NULL,
Subject VARCHAR(30) NOT NULL,
Grade CHAR(1)
)
let's say have following record in SubjectGrade
1Maths
I havn't write my schema clearly , (StudentID, Subject) is the key of
SubjectGrade
Philippe Poelvoorde [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED] ???...
Alternatively, use an IN list for the subject, then use a HAVING clause
to limit the results to students with 2 matching rows, like this:
So i have to write 3 join if I have 3 conditions and so on, right?
Scott Noyes [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED] ???...
Select s.StudentID, s.StudentName from Student s, SubjectGrade sg where
s.StudentID = sg.StudentID and sg.Subject = 'Maths' and sg.Subject =
'Chem'
and sg.Grade =
Thanks Scott!
Scott Noyes [EMAIL PROTECTED] ???
news:[EMAIL PROTECTED] ???...
SELECT s.StudentID, StudentName
FROM Student s
JOIN StudentGrade sg1 USING (StudentID)
JOIN StudentGrade sg2 USING (StudentID)
WHERE
sg1.Subject = 'Maths' AND sg1.Grade = 'A'
AND sg2.Subject = 'Chem' AND