Website Development Prices

Search Blog

Wednesday, May 13, 2015

Operatori za poredjenje za odredbu WHERE (The operators of comparison for WHERE clause)


U istom iskazu SELECT mozete da zadate vise uslova istovremeno kao i sintaksu za prepoznavanje uzoraka, koje cete povezati logockcim operatorima AND ili OR.

Primer:

1. Pokrenite XAMPP. Kliknite na Admin u liniji MySQL-a ili ukucajte u address bar
http://localhost/phpmyadmin/

2. Sa leve strane izaberite bazu podataka volimmotore.

3. Ubacite sledeci kod

select *
from porudzbine
where sifrakupca = 2 or sifrakupca = 1;

4. Klik na dugme "Go".



In the same statement SELECT you may also specify several conditions at the same time as the syntax for pattern recognition, which will connect with logical operators AND or OR.

Example:

1. Start XAMPP. Click on the Admin in line of MySQL or type in the address bar http://localhost/phpmyadmin/
2. From the left select the database lovemotobikes.
3. Insert the following code

SELECT *
FROM orders
WHERE customerid = 2 or customerid = 1;

4. Click on the "Go" button.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.