Reputation: 2397
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?
Upvotes: 1
Views: 97
Reputation: 560
The below queries were both similar. The first one is with Table Alias and the second one without.
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
--Is similar as the below Query.
SELECT
FEED_LEFTOVERS.LEFTOVER_DATE, FEED_LEFTOVERS.LEFTOVER_ID, ANIMALS.ANIMAL_NUMBER
FROM
FEED_LEFTOVERS , ANIMALS
WHERE
FEED_LEFTOVERS.ANIMAL_ID = ANIMALS.ANIMAL_ID
Upvotes: 0
Reputation: 6337
It's a alias name given to table in sql query.
eg:
Alias name for table FEED_LEFTOVERS
is FLO
. Similarly ANIM
for ANIMALS
Upvotes: 2