I’m trying to figure out what the best type of join I could use in TSQL for merging records in about 6 tables where there is a match. So I have 6 different tables where there are many matching records. So I figured that I would use a left join in my first join, keep [...]
Can I join from one file to another on more than one column? For example, join from FileA to FileB on OrderNumber.A=OrderNumber.B AND ItemNumber.A=ItemNumber.B? All examples show only one column… I am on an AS400 using RPGLESQL, I need to join from one detail file to another detail file.
Hi, can you help me how to join the two files but the two fields are not the same length e.g. 1st field (left side) is 9 (ex. A005B2589 job#) and the 2nd field (right side) is 11 (ex. A005B258901… the last two digit 01 is for partial#), kindly advise if it’s possible? Thanks and regards…
I need expert help. I need to create a query that will use four tables. Each table has a column of data that I need for the report. The end result should display the following: Name, City, Amount, Reason. Here is my first query that gives me the name and city: SELECT “T16.GNAM”.N_NAME, “T16.GNAM”.N_CITY FROM [...]
I am joining four files. Each file has one field I need for my report. How do I determine which file is the primary one? Should the select records criteria all come from the primary file? As long as I test fields First>Second, Second>Third, Third>Fourth, shouldn’t it work just fine?
Hi, I have a table. It can have multiple records for the key value. Ex secid time source 1 02:04 a 1 02:04 b 2 3 Now i want only one record of secid for a descending orderby of (source) and for a max time stamp. and later i will join the secid with the [...]
Why are naturl JOIN keywords not an option for producing a self-join?
i have 2 tables unittypes,rules unittypes has unitid and description unitid description A1 description1 A2 description2 A3 description3 rules has id unitid 1 A1,A2 2 A1,A3 i am trying to get it to get a resultset like 1 description1,description2 2 description1,description3 the sql i wrote was select r.unitid ,(select distinct description from unittypes where unittypes.unitid [...]
Hi, my need is to update a table with a join of 2 other tables. The first table (a) has 5 columns (product_id number, ist number, plan number, plan_w number, ist_w number) The second table (b) has 2 columns (prod_group_id number, percent number) The third table (c) has 2 columns (product_id number, prod_group_id number) My [...]
I have a table with Inventory transacation records. The table contains both Shipment (outgoing) and Receiving (incoming) transactions. I’m trying to write a report that lists both Sales Orders that result in Shipment records and Purchase Orders that result in Receiving records. If I link the Inventory Transaction table to the Shipment (Sales Order) tables [...]
I am new to sql and cannot work out the query for this: >>>List the films in which ‘Harrison Ford’ has appeared <<< movie(id, title, yr, score, votes, director) actor(id, name) casting(movieid, actorid, ord) The whole exercises can be found on http://sqlzoo.net/3.htm thanks in advance A.
What is the difference between Outerjoin and Left outerjoin.
Does anyone know how to write the SQL to join two DB2 tables when the name of Table1.columnA equals the data values stored in Table2.columnB? In the table structure examples listed below, I’m trying to figure out how to join Table1 and Table2 when the values in Table2.Tag_Name are equal to the column names in [...]
Hi Experts, Pls hlp me with my query How can i join 3 tables using JOIN Keyword inside PL/SQL block in SELECT … WHERE clause Query 3 Tables namely Reg,ROOTS,ME and the select statement takes both parameter variable and local variable Thanks!!!!!
I have a question regarding database design. Lets assume that there is a table with 10 columns. I don’t have any single column which I can choose as candidate for Primary key. Though, combination of 5 columns can uniquely identify records. Here, I created an identity column as a PK and added UNIQUE constraint on [...]
I have two files and I’d like to join and make a group-by on a xycod, in order to count the number of occurrences. This is the question: What happens on the RRN filed when i try to do group by statement? There is one-to-many relation between records and RRNs, so which is the RRN [...]
I’m not sure what says the ansi norm about this SELECT * FROM a LEFT JOIN b ON b.mast_id = a.id AND b.flag = 1. Is it possible (by the ansi norm) to use in “ON” condition more then one boolean expression? Like in this case condition compounded by two expressions? Of course, meaning by [...]
pls help, can using clause is simmilar to non equi join,if yes how is it
pls Help, can we call non-equi join and self join as inner join ,if yes pls give some resion
what is the diffrences between oracle proprietary join and sql 1999 compliant joins





