I have 3 tables Animals , Type, Country.
Animals
*Id | Name | Type | Location*
001 | bear | 1 | 54
003 | snake | 4 | 32
005 | penguin | 3 | 46
Type
*Id | Name*
1 | Mammal
3 | Bird
4 | Reptile
County
*Id | Name*
54 | Canada
32 | Africa
46 | Antartica region
My required out is like below Animals a and Type t and Country c
List of Animals
Id | Name of Animal | Type of Animal | Country
a.id| a.name | t.name | c.name
For List of Animals output below is the query
select a.id, a.name, t.name, c.name
from Animals a
INNER JOIN Type t
ON t.id = a.Type
INNER JOIN Country c
ON c.Id = a.Location
I know how create INNER JOIN, is there any possibilites where I have table Animals i have lots of records and some extra fields (23 columns)
Now how can Join these tables with all fields of Animals table without writing a.id, a.name, a.xyz, a.lkf, a.lfsl, t.name, …. some extra fields related to animals
Is there any method or query, where i can all records of animals as well as INNER JOIN with other tables
Try
SELECT a.*to select all columns from the Animals table.(if that is what you’re trying to do… If I understand the question correctly)