By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

how to select table based on id even/odd in another table

P: 1
Hi, I want to ask. i have 2 quiz tables that consists of quizzes and also student table. i want to select the quiz table based on when the student register id even, the student will get quiz table set 1, and if student id is odd, get the second quiz table.
i have set the id as primary key in student table
can anyone help mee?

im using php language and mysql.
Dec 10 '18 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,035
Use the MOD function

Expand|Select|Wrap|Line Numbers
  1. SELECT MOD(1,2), MOD(2,2), MOD(3,)
This returns: 1,0,1
Dec 14 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.