selecting multiple columns with where clause in sql

selecting multiple columns with where clause in sql

A student studies more than 1 optional subject. I have created two columns named optional_sub1 and optional_sub2. I want to select only one column from two using sql statement. SQL statement is as under:

A student studies more than 1 optional subject. I have created two columns named optional_sub1 and optional_sub2. I want to select only one column from two using sql statement. SQL statement is as under:

$sql= "SELECT * 
       FROM students 
       WHERE class = '$SelectClass' 
       && optional_sub1 = '$SelectSubject' 
       || optional_sub2 = '$SelectSubject'";

Please modify the above syntax. Thanks.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

What are the differences between Standard SQL and Transact-SQL?

In this article, we'll explain syntax differences between standard SQL and the Transact-SQL language dedicated to interacting with the SQL

SQL Full Course - SQL Tutorial For Beginners - MySQL Essentials - SQL Training

This SQL Full Course video will cover all the topics of SQL starting from scratch. This video is great for beginners who want to learn SQL and for advanced people to brush up their skills.