alias - Trying to use table aliases in SQL -


I am a graphic designer who is trying to understand tables, but it is not working. I have so far:

  to as as colours.colourid colourid1, combinations.manufacturercolourid colourmanid1, colours.colourname colourname1, colours.colourhex colourhex1, combinations. Qecolourid2 as colouridqe2, in the form of color. Colourid as Colourid2, colours.colour.colourname colorname2, colors.colourhex as colourhex2, colors.colourid ascolourid3, combination. Xecolourid3 as colouridqe3, colours.colourname ascolourname3, colours.colourhex as colourhex3, colours.colourid as colourid4, combination. Xecolourid4 AS Colouridq4, colours.colour name COLORname4, colours.colourhex as colourhex4, Join colors combos.coloursupplierid inner colors combinations. Color = combination the creator;  

Now, the idea is that in the color lookup table, the ID will pull names from the color code, hex and lookup table so that I can pull the color code, hex and name for 4 colors which I'm watching. I can get it to work, but it only pulls the first name, code and hex and I am not seeing what I am doing now.

Your problem is that you are simply linking from the color table to the same record because your SQL There is only one join in This is the reason that the record color will match specified by manufacturer_colour_id.

You also have another problem that your combination table may be in the proper form (although I may be wrong, it does not appear to know the actual form.

If I understand correctly your problem, then the solution (using your current table structures) would be something like:

  select C1 Crolid ASC colorful 1, Simbikutpadk Kolirid AS ColorimiMedia 1, C1 CrawlerM AS Color Names 1, C1 Olorheks AS Rnginheks 1, Simbikkyuclorid 2 ASC Koloridaki 2, C2 Kolorid ASC Color 2, C2 crawler ASC Rngnam 2, C2 Kolorheks AS Rnginheks 2, C as 3 .colourid colourid3, CMB as .qecolourid3 colouridqe3, as C3.colourname colourname3, as C3.colourhex colourhex3, as C4.colourid colourid4, as CMB.qecolourid4 colouridqe4, as C4.colourname colourname4, C4.colourhex As Colourhex4, join the CMB Left Colored CMB with CML.coloursupplierid C1 colarid = CMB.manufacturercolourid on C1 The exterior paint Join C2 to C2 Kcolourid = CMBkqecolourid2 Left exterior paint Join C3.colourid = CMB.qecolourid3 left outer join color C 3 C 4 C4.colourid = CMB.qecolourid4  < / Pre> 

That's what I'm going to do here by adding four times the table of colors, once for each color_id field in the combination table. To do this, I would have to name the name of the table every time so that I know which of the four possible colors of colors to use in the list of returned columns. Also, I'm using additional jones in the event that one or more color_it columns may be blank. If this happens then with Inner Johns, the entire line will exit the results set.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -