Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

MAX(reg_number) as reg_no

SELECT book_name,isbn_no,
IF((SELECT COUNT(*) FROM book_mast WHERE pub_lang='English')>
(SELECT COUNT(*) FROM book_mast WHERE pub_lang<>'English'),
(CONCAT("Pages: ",no_page)),(CONCAT("Price: ",book_price)))
AS "Page / Price"
FROM book_mast;

SELECT reg_id, IF(reg_student_transfer='0',max(reg_number),max(reg_number)) from


vivo_registration WHERE reg_student_branch='5'

SELECT count(regno.max_nom) as count_no, regno.max_nom from (SELECT max(reg_number)


as max_nom from vivo_registration where reg_student_branch=5 AND
reg_student_transfer='0' AND reg_number IN (SELECT reg_number from
vivo_registration)) as regno

SELECT count(regno.max_nom) as count_no, regno.max_nom from (SELECT max(reg_number)


as max_nom from vivo_registration where reg_student_branch=5 AND
reg_student_transfer='0') as regno where regno.max_nom+1 IN (SELECT reg_number from
vivo_registration where reg_student_branch=5)

SELECT reg_id,
IF(SELECT count(regno.max_nom) as count_no, regno.max_nom from (SELECT
max(reg_number) as max_nom from vivo_registration where reg_student_branch=5 AND
reg_student_transfer='0') as regno where regno.max_nom+1 IN (SELECT reg_number from
vivo_registration where reg_student_branch=5))=1,(CONCAT("Pages: ",no_page)),
(CONCAT("no: ",reg_number))
AS "Page / Price"
from vivo_registration WHERE reg_student_branch='5'

You might also like