Welcome Guest, Not a member yet? Register   Sign In
Primary and unique field
#1

[eluser]zlatiborac[/eluser]
I have a very simple table with two columns, id which is primary and name which is unique.
When I insert data in this table and try
Code:
select * from tags
I receive this result
Code:
mysql> select * from test;
+----+-------+
| id | name |
+----+-------+
| 2 | drugi |
| 1 | prvi |
| 3 | treci |
+----+-------+
3 rows in set (0.00 sec)
which is very odd.
But if I remove unique attribute from second column (name) I get the result as expected
Code:
mysql> select * from test;
+----+-------+
| id | name |
+----+-------+
| 1 | prvi |
| 2 | drugi |
| 3 | treci |
+----+-------+
Can anyone explain what happened here and why is this happening.




Theme © iAndrew 2016 - Forum software by © MyBB