Using User

Nasza ocena:

5
Wyświetleń: 588
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Using User - strona 1

Fragment notatki:

Using User-Defined Variables
You can employ MySQL user variables to remember results without having to store them in temporary
variables in the client. (See Section 9.4, “User-Defined Variables”.)
For example, to find the articles with the highest and lowest price you can do this:
mysql SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop;
mysql SELECT * FROM shop WHERE price=@min_price OR price=@max_price;
+---------+--------+-------+
| article | dealer | price |
+---------+--------+-------+
| 0003 | D | 1.25 |
| 0004 | D | 19.95 |
+---------+--------+-------+
... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz