Black Lotus Black Lotus - 6 months ago 14
SQL Question

SQL Server : what does FLO.Tablename mean?

I tried googling it but without result.

For some time I have been working on a old project someone else started many years ago.

Today while working on it I came across this data access class with some weird query.

SELECT
FLO.LEFTOVER_DATE, FLO.LEFTOVER_ID, ANIM.ANIMAL_NUMBER
FROM
FEED_LEFTOVERS AS FLO, ANIMALS AS ANIM
WHERE
FLO.ANIMAL_ID = ANIM.ANIMAL_ID


The thing I don't understand on this line is what the
FLO.
means.

I first thought it was just part of the table name but it clearly isn't (I did check). Googling didn't point me to any information about it either.

Thus I was wondering if anyone here would be able to give me an explanation about it?

Answer

It's a alias name given to table in sql query.

eg:

Alias name for table FEED_LEFTOVERS is FLO. Similarly ANIM for ANIMALS