sql calling columns of the same name from two different tables -


I'm trying to solve it

"Show details for cage number 144. Cage Include the name of each animal in the cage with the animal cage in the cage, the animals behind the cage, and the cage with the names of the keepers who care for each animal. The data from the oldest to the lowest of each animal is "

Here's my query:

  SELECT a.cageno, c.name AS "Animal Name", a .keeperID, b.surname as "cage guarding", c care id, b. As the name of "Animal Keeper", DN.N. As a "species name" cage, one by one, protector B, animal c, coin de WHERE a.cageNo = 144 and c.keeperID = b.keeperID by order c. DOB DESC   

The problem here is that I want to get the Animal Keeper's name from the protector table but it has also been used for the name of the cage keeper and originally I received I am trying to do a different set of cage-keepers as well as a different set of names of animals who care for me.

If I understand your question well, then you need to select a column twice Will be It is possible to do this as your example (not 100% sure, here is not to try an SB server). If this does not work, you can use a table twice.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -