0

I have table like this.

id_people | name
1            John
4            Jenny
7            Nik

results i want.

no     |  name
1         John
2         Jenny
3         Nik  

I want to running query to select data from my table with statement everything (*) without show Primary key and unique field and without having to call all name of field. Can i do that ?

user3089464
  • 251
  • 6
  • 14

1 Answers1

0

You can do something like this:

SELECT  @a:=@a+1 no, p.* FROM people p,(SELECT @a:= 0) AS a;
Manu
  • 109
  • 1
  • 5
  • Thanks @Manu. But i mean, Can i create query mysql with statement * (everything) without showing Primary key and unique field ? – user3089464 Jan 24 '14 at 09:09
  • yes you can achieve this. For better and v.good explanation check the link : http://stackoverflow.com/questions/9122/select-all-columns-except-one-in-mysql – Manu Jan 24 '14 at 09:39