//// andrew is adh'afulbasyar but i've powerfull: sql

Senin, 17 Agustus 2009

sql

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select lcase('technik informatika');
+------------------------------+
| lcase('technik informatika') |
+------------------------------+
| technik informatika |
+------------------------------+
1 row in set (0.02 sec)

mysql> select lower('technik informatika');
+------------------------------+
| lower('technik informatika') |
+------------------------------+
| technik informatika |
+------------------------------+
1 row in set (0.00 sec)

mysql> select ucase('technik informatika');
+------------------------------+
| ucase('technik informatika') |
+------------------------------+
| TECHNIK INFORMATIKA |
+------------------------------+
1 row in set (0.00 sec)

mysql> select upper('technik informatika');
+------------------------------+
| upper('technik informatika') |
+------------------------------+
| TECHNIK INFORMATIKA |
+------------------------------+
1 row in set (0.00 sec)

mysql> select substring('technik informatika', 6);
+-------------------------------------+
| substring('technik informatika', 6) |
+-------------------------------------+
| ik informatika |
+-------------------------------------+
1 row in set (0.00 sec)

mysql> select substr('computer', 3);
+-----------------------+
| substr('computer', 3) |
+-----------------------+
| mputer |
+-----------------------+
1 row in set (0.00 sec)

mysql> select substring('teknik informatika',2,6);
+-------------------------------------+
| substring('teknik informatika',2,6) |
+-------------------------------------+
| eknik |
+-------------------------------------+
1 row in set (0.00 sec)

mysql> select substring('tehnik informatika',8,11);
+--------------------------------------+
| substring('tehnik informatika',8,11) |
+--------------------------------------+
| informatika |
+--------------------------------------+
1 row in set (0.00 sec)

mysql> select substring('tehnik informatika'.-11,5);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual t
corresponds to your MySQL server version for the right syntax to use near '.
5)' at line 1
mysql> select substring('tehni infortika',-18'5);
'> SELECT SUBSTRING('TEHNIK INFORMATIKA',-11, 5');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual t
corresponds to your MySQL server version for the right syntax to use near ''
SELECT SUBSTRING('TEHNIK INFORMATIKA',-11, 5')' at line 1
mysql> SELECT SUBSTRING('TEHNIK INFORMATIKA',-11, 5);
+----------------------------------------+
| SUBSTRING('TEHNIK INFORMATIKA',-11, 5) |
+----------------------------------------+
| INFOR |
+----------------------------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT SUBSTRING('TEHNIK INFORMATIKA',-18,18
-> select substring('tehni infortika',-18, 18)
->
-> select substring('tehni infortika',-18, 18);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual t
corresponds to your MySQL server version for the right syntax to use near 's
t substring('tehni infortika',-18, 18)

select substring('tehni infortika',' at line 2
mysql> SELECT SUBSTRING('TEHNIK INFORMATIKA',-18, 18);
+-----------------------------------------+
| SUBSTRING('TEHNIK INFORMATIKA',-18, 18) |
+-----------------------------------------+
| TEHNIK INFORMATIKA |
+-----------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT LEFT(TEHNIK INFORMATIKA', 6);
'> SELECT LEFT('TEHNIK INFORMATIKA', 6);
'> SELECT LEFT(TEHNIK INFORMATIKA',6);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual t
corresponds to your MySQL server version for the right syntax to use near 'I
MATIKA', 6);
SELECT LEFT('TEHNIK INFORMATIKA', 6);
SELECT LEFT(TEHNIK INFOR' at line 1
mysql> SELECT LEFT('TEHNIK INFORMATIKA', 6);
+-------------------------------+
| LEFT('TEHNIK INFORMATIKA', 6) |
+-------------------------------+
| TEHNIK |
+-------------------------------+
1 row in set (0.00 sec)

mysql> SELECT RIGH('TEHNIK INFORMATIKA', 11);
ERROR 1305 (42000): FUNCTION RIGH does not exist
mysql> SELECT RIGHT('TEHNIK INFORMATIKA', 11);
+---------------------------------+
| RIGHT('TEHNIK INFORMATIKA', 11) |
+---------------------------------+
| INFORMATIKA |
+---------------------------------+
1 row in set (0.00 sec)

mysql> SELECT ASCTI('5');
ERROR 1305 (42000): FUNCTION ASCTI does not exist
mysql> SELECT ASCII('5');
+------------+
| ASCII('5') |
+------------+
| 53 |
+------------+
1 row in set (0.00 sec)

Tidak ada komentar:

Posting Komentar