JOIN statement Questions


Join for merging records
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 [...]

Answer Question   |  July 12, 2010  12:08 PM
JOIN statement, SQL Server 2005 Express, SQL Server 2005 merge replication, SQL tables
asked by:
175 pts.

SQL Join on multiple columns?
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.

Answer Question   |  April 25, 2010  6:50 PM
AS/400, JOIN statement, SQL
asked by:
100 pts.

Wrkqry for join files
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…

Answer Question   |  October 18, 2011  8:57 AM
JOIN statement, WRKQRY
asked by:
25 pts.

AS400 Query Join
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 [...]

Answer Question   |  December 31, 2009  5:45 PM
AS/400 Query, JOIN, JOIN statement
asked by:
365 pts.

AS/400 Query Join
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?

Answer Question   |  December 30, 2009  9:12 PM
AS/400 Query, JOIN statement
asked by:
365 pts.

get a anr record from databse by using max (one Field) and orderby (one filed) desc
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 [...]

Answer Question   |  October 22, 2009  1:12 PM
Database issues, JOIN statement, Oracle Database
5 pts.

Why are naturl JOIN keywords not an option for producing a self-join?
Why are naturl JOIN keywords not an option for producing a self-join?

Answer Question   |  October 7, 2009  2:16 PM
JOIN statement, SQL procedure
asked by:
5 pts.

query for 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 [...]

Answer Question   |  June 4, 2009  12:50 PM
JOIN statement, SQL Server Query, SQL Server tables
asked by:
5 pts.

Multiple Join Update
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 [...]

Answer Question   |  April 24, 2009  11:47 AM
JOIN statement, SQL, SQL queries, UPDATE statement
asked by:
25 pts.

SQL Server Query Help Needed
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 [...]

Answer Question   |  February 6, 2009  10:39 PM
INNER JOIN, JOIN statement, LEFT JOIN, RIGHT JOIN, SQL, SQL queries, SQL Query, SQL Server development, SQL Server Query
asked by:
70 pts.

can you help on this query?
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.

Answer Question   |  January 20, 2009  11:49 PM
JOIN statement, SQL, SQL Query
asked by:
5 pts.

Joining Tables in SQL Server
What is the difference between Outerjoin and Left outerjoin.

Answer Question   |  December 20, 2008  10:23 AM
JOIN statement, LEFT OUTER JOIN statement, OUTER JOIN statement, SQL Server development, SQL Server Query, SQL statements
asked by:
15 pts.

SQL Table Join when the name of a column in Table1 equals the value of a column in Table2
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 [...]

Answer Question   |  November 3, 2009  8:13 AM
Conditional JOIN, Conditional SQL statements, Conditional statements, DB2 SQL, JOIN statement, SQL
asked by:
5 pts.

How can I join 3 tables using JOIN keyword
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!!!!!

Answer Question   |  December 8, 2008  6:20 AM
JOIN statement, PL/SQL, SELECT statement, SQL, SQL Query, WHERE statement
asked by:
610 pts.

designing indexes
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 [...]

Answer Question   |  October 14, 2008  3:31 PM
Database design, Indexes, JOIN statement, Primary keys
asked by:
25 pts.

RRN and JOIN…
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 [...]

Answer Question   |  August 22, 2010  1:27 PM
JOIN statement, RRN
asked by:
15 pts.

LEFT JOIN depending on more conditions
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 [...]

Answer Question   |  October 13, 2008  8:01 AM
ANSI norm, Database programming, JOIN statement, LEFT JOIN
asked by:
5 pts.

Join clause vs. nonequi join
pls help, can using clause is simmilar to non equi join,if yes how is it

Answer Question   |  August 15, 2008  1:49 PM
Join logical files, JOIN statement, Oracle developers
asked by:
50 pts.

Nonequi join and self join as inner join
pls Help, can we call non-equi join and self join as inner join ,if yes pls give some resion

Answer Question   |  August 13, 2008  1:47 PM
Join logical files, JOIN statement, Oracle developers
asked by:
50 pts.

joining what is the diffrences between oracle proprietary join and sql 1999 compliant joins
what is the diffrences between oracle proprietary join and sql 1999 compliant joins

Answer Question   |  August 13, 2008  12:44 PM
Join logical files, JOIN statement, Oracle proprietary joins, SQL compliant joins
asked by:
50 pts.