Website Development Prices

Search Blog

Tuesday, May 12, 2015

Ucitavanje podataka upotrebom odredbe WHERE (Loading data using the WHERE clause)

Da biste izdvoji odredjeni podskup  redova iz tabele - zadati uslov za njihov izbor.

Primer: 

select *
from porudzbine
where sifrakupca = 2;

Odredba WHERE ucitava sve kolone iz tabele porudzbine, ali samo iz redova u kojima je identifikator kupca, sifrakupca jednaka 2.

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;

4. Klik na dugme "Go".



U sledecem postu pogledajte skup operatora za poredjenje koji se najcesce koriste u izrazu WHERE.

To single out a certain subset of rows in the table - give condition for their choice.

Example:

SELECT *
FROM orders
WHERE customerid = 2;

The WHERE clause is loading all the columns in the table orders, but only the rows in which the id of customer, customerid is equal to 2.

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;

4. Click on the "Go" button.


In the next post, see a set of operators for comparisons that are commonly used in the WHERE clause.

No comments:

Post a Comment

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