ragekc Posted June 1, 2006 Share Posted June 1, 2006 i have the folowing code:"SELECT LAST(codigocliente) AS highest_codigocliente FROM tblsorteio ORDER BY codigocliente";all that does(i think)...gets the last entry in the colum(codigocliente)...and the order by, orders them in onder from least to greatest...so codigo cliente = client code ... so it pulls out the last client registered in the DB ....i wanna know what does the part ... AS highest_codigocliente , do and do i need it in the code??w3schools said its an expression.. what is an expression??.. the resto of the code i understand.and one last thing .... if i can eliminate the ( AS highest_codigocliente ) how would the code look like??THANKS!!!!!! Link to comment Share on other sites More sharing options...
aspnetguy Posted June 1, 2006 Share Posted June 1, 2006 it is just 'renaming' the column.when you access it through your data array (Server Side Script) or it is displayed in your database program the column title will be highest_codigocliente instead of LAST(codigocliente)It is mostly for SQL Reports and such where you want hte output to look nice. Link to comment Share on other sites More sharing options...
ragekc Posted June 1, 2006 Author Share Posted June 1, 2006 thanks man!!! .. so it isn´t important since im not going to use it.. Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 4, 2006 Share Posted June 4, 2006 You do can just delete that part, it would just validly look like this: SELECT LAST(codigocliente) FROM tblsorteio ORDER BY codigoclienteBut as aspnetguy said, the column then would be named (in the results) as "LAST(codigocliente)" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now