|
I want to select all values from @table1 that doesn't exist in @table2 , for that see the below scenario and the query, although i get the correct result but i doesn't understand how query is evaluated , I know the concept of left join but how where is evaluated , i can't understand ?
Is query is evaluating like this
1 from @table1 & 1 from @table2
then , 1=1 and t2.id is null = 1=1 and false= no rows.
now , suppose
2 from @table1 and 1 from @table2
then , 2=1 and t2.id is null = 2=1 and false = no rows , according to me but here it is giving 2,
IS Where condition applies only to those rows that are equal in both table.
Please help me ?
DECLARE @Table1 TABLE
(
ID INT
)
INSERT @Table1
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT 7
DECLARE @Table2 TABLE
(
ID INT
)
INSERT @Table2
SELECT 1 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 7 UNION ALL
SELECT NULL
SELECT t1.ID
FROM @Table1 AS t1
LEFT JOIN @Table2 AS t2
ON t1.ID = t2.ID
WHERE t2.ID is null
|
|
|
|
|
From SQL Server books online, you may want to spend some time looking through it;
Inner joins (the typical join operation, which uses some comparison operator like = or <>). These include equi-joins and natural joins.
Inner joins use a comparison operator to match rows from two tables based on the values in common columns from each table. For example, retrieving all rows where the student identification number is the same in both the students and courses tables.
Outer joins are specified with one of the following sets of keywords when they are specified in the FROM clause:
LEFT JOIN or LEFT OUTER JOIN
The result set of a left outer join includes all the rows from the left table specified in the LEFT OUTER clause, not just the ones in which the joined columns match. When a row in the left table has no matching rows in the right table, the associated result set row contains null values for all select list columns coming from the right table.
RIGHT JOIN or RIGHT OUTER JOIN
A right outer join is the reverse of a left outer join. All rows from the right table are returned. Null values are returned for the left table any time a right table row has no matching row in the left table.
FULL JOIN or FULL OUTER JOIN
A full outer join returns all rows in both the left and right tables. Any time a row has no match in the other table, the select list columns from the other table contain null values. When there is a match between the tables, the entire result set row contains data values from the base tables.
|
|
|
|
|
This article [^]may help as well Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I know that but what i am asking how that cartesian product is done when " where condition is used in left join"
|
|
|
|
|
I am thinking this tabbed form method in Access 2007 could be good...
If I set my forms to come up as tabbed forms, can i design a pop-up form to be visible only in the current tabbed form/window?
Aside from a complex set of checks on current view state, is there a property setting that locks a pop-up form to the current parent that launched this pop-up?
Or, is there a way to check what tabbed form is currently active? I'm trying to avoid the user getting buried in a sea of pop-ups, but still allow him to switch between forms if he needs to.
Thanks so much,
JJ
|
|
|
|
|
john john mackey wrote: Aside from a complex set of checks on current view state, is there a property setting that locks a pop-up form to the current parent that launched this pop-up?
Not sure if VBA supports it, but you could try to set the new windows as a Child -control of the ParentForm.
john john mackey wrote: Aside from a complex set of checks on current view state
Viewstate? Are you trying this from Access or from an ASP.NET application?
john john mackey wrote: Or, is there a way to check what tabbed form is currently active?
That's usually possible, there's a property called "ActiveTab", "SelectedTab" or "SelectedIndex".I are Troll
|
|
|
|
|
I am doing this in MS Access 2007.
I found something about a property (Screen.ActiveForm) - this probably means that I will have to do my own Form, Parent/Child management.
Thanks for the advice on looking about a Child property. I will check into this.
|
|
|
|
|
I have project call Managmnet information system for finace,
I use the
1- oracle database 10g
2- oracle developer 10g
I am not have anything about two this software.
I want project alreay did by to this software
or toturial
|
|
|
|
|
I think you are doing your boss/client a disservice!
Get hold of a book on database design, read a bunch of articles, have a wander through SQLServerCentral.com.
Depending on the size if the business you are taking on a very large project, one that will take a skilled single developer a substantial amount of time to even understand the business requirements let alone the database design, etl management, data structuring, business logic layer and delivery interface.
Good luck, you are going to need it!Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Here: Library of free data models[^].
Also: OraFAQ[^]
Good luck: you're plainly going to need it - does your boss know you have no idea where or how to start?Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
What and excellent link - it could help a lot of people here. Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You mean it could let a lot of lazy idiots leverage someone else's work without understanding it?
|
|
|
|
|
Rob Graham wrote: lazy idiots
So you know anush 6 threads up, hopefully they can gain something from seeing a data structure, without any understanding I doubt a canned structure is going to really help someone.Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This allows you to execute commands asynchronously (ADO 2) using BeginXXX and EndXXX in .NET in the traditional way.
But, if you want Async access, you could just use multiple threads for that (probably using seperate connections).
What does this entry in the connection string actually do? Is it a case of allowing more than one command to execute at a time against a single connection?Regards,
Rob Philpott.
|
|
|
|
|
Absolutely no idea, never used it, never looked into it, was not even aware it existed. I have not looked at a connection string for many years. I wonder if I am missing something? Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Rob Philpott wrote: What does this entry in the connection string actually do?
Found some good explanation (with usage scenario's) on MSDN[^];
MSDN:
In previous versions of the .NET Framework it was possible to simulate non-blocking execution by using asynchronous delegates or the ThreadPool class; however, those solutions simply blocked another thread in the background, making them far from ideal for cases where it is important to avoid blocking threads [...]
I are Troll
|
|
|
|
|
Hi there,
I want a way to stream data from one table in one database to the same table on a different machine.
Is there a way?
Any help would be much appreciated.
Kind regards,
Hugo
|
|
|
|
|
Option 1: replication
Option 2: write a job to perform the bulk transfer.
|
|
|
|
|
If you don't need to do this in real-time, then you could consider taking a nightly backup of Server A and performing a restore on Server B.
Just a thought.
|
|
|
|
|
If you are using Sql Server 2005 or later, you can use Service Broker.
|
|
|
|
|
bonkers123 wrote: Is there a way?
Multiple, and their applicability depends on the type of database that you're using. SQL Server for example has the option to "link" to another database. It also depends a bit on what you expect from the target-table. Does it have to be "up to date" at all times, or would it be sufficient to have access to yesterday's data?
To add to the pile of options; you could also use the Microsoft Synchronization Framework.I are Troll
|
|
|
|
|
It has to be up to date at ALL times... It's a sql database...
|
|
|
|
|
So how do I link a table of one db, to a the same table on a different db ... ?
|
|
|
|
|
From the Management Studio, expand "Server Objects", right-click on "Linked Servers" and select "New Linked Server". There's several options to specify the credentials for the remote database.
E.g., if you have Server A (with a master database) and a Server B (with AdventureWorks), then you could execute queries like this;
SELECT [name]
FROM [master].[sys].[tables]
UNION ALL
SELECT CAST([VersionDate] AS VARCHAR(50))
FROM [ServerB].[AdventureWorks].[dbo].[AWBuildVersion]
More information on configuring a linked server can be found here. Hope this helps I are Troll
|
|
|
|
|