|
As Piebald suggest, you need the relationship in the join. You can include the filter as well but the relationship must be there.
SELECT File_Info.File_Name, SaleInformation.PID, SaleInformation.Sale_date, SaleInformation.Sale_price
FROM File_Info LEFT OUTER JOIN SaleInformation ON File_Info.PID = SaleInformation.PID
and SaleInformation.Sale_price > 150000
or
SELECT File_Info.File_Name, SaleInformation.PID, SaleInformation.Sale_date, SaleInformation.Sale_price
FROM File_Info LEFT OUTER JOIN SaleInformation ON File_Info.PID = SaleInformation.PID
WHERE SaleInformation.Sale_price > 150000
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks!
I had some trouble making it work - but it all came down to simply having the tables on the wrong sides of the LEFT OUTER JOIN. Switched them around and it is return as I wanted!
Cheers for the assistance.
|
|
|
|
|
This is one of the most useful articles [^]about joins I have seen
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks again!
Great article - definitely helped me understand.
|
|
|
|
|
I am using C# with MySQL..
I want to know what's the best way to save the System.Color in mySQL?
|
|
|
|
|
Try saving as argb
color.Red.ToArgb().ToString
or in HEX
color.Red.ToArgb().ToString ( "X8" )
Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post
|
|
|
|
|
yeah, I liked that thread too. I would however have preferred System.Color to serialize just like a simple integer all by itself!
|
|
|
|
|
Excellent answer! I was about to same the same thing.
|
|
|
|
|
How can I select a random record in mySQL,. something similar to the ORDER BY newid() in MS SQL?
|
|
|
|
|
|
|
what's the best way to save duration in mySQL..
with duration I mean 1 hour and 25minu (1:20)
it might be more than 23hours sometime... like (31:17)
|
|
|
|
|
I'd either store it as a number (in seconds), or as two datetimes.
I are Troll
|
|
|
|
|
Hi,
I would like to know what is the DBA tasks? what is he/she doing?
if I wanna be DBA do I need to start with SQL Server or Oracle? cold you please advice me how should I start? what sort of certification do I need?
|
|
|
|
|
Have you tried this? Database Administrator[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
future3839 wrote: start with SQL Server or Oracle?
No. You need a broader understanding of the subject.
future3839 wrote: how should I start?
Go to school. Get a high-level understanding of all types of database.
|
|
|
|
|
I have a question, I hope this has not been asked before
But I have a stored procedure which I have to EXEC in order to get a results set, and then pop the results set into an Excel report.
Problem is, the results set is known to have 100,000's of rows. Now, I've read on Google about SET ROWCOUNT and I did the following as a test...
SET ROWCOUNT 5
EXEC ....
However, doing that gives me nothing back, not the top 5 rows of the results set like I expect. I don't want to put a TOP 5 (or TOP X you get the idea) in my SELECT inside the stored procedure because doing that will break functionality elsewhere.
I just want the top X rows right now just for testing purposes, and then when I am ready to deploy I plan to have it give me the full query (the query runs as a scripted console app on a remote server somewhere at regularly scheduled times).
Thanks for any inputs!
Sincerely Yours,
Brian Hart
|
|
|
|
|
Brian C. Hart, Ph.D. wrote: I don't want to put a TOP 5 (or TOP X you get the idea) in my SELECT inside the stored procedure because doing that will break functionality elsewhere.
Make a second version with a different name?
I are Troll
|
|
|
|
|
I did that and it worked! Thanks [ ]
Sincerely Yours,
Brian Hart
|
|
|
|
|
You're welcome
|
|
|
|
|
How about
create or replace procedure SomeProcedure (
input_select_count integer default null
)
as
...
...
begin
...
if ( input_select_count is NULL )
....
else
....
Even better to have the count applied to your SQL as a parameter so that your code can control the number of rows returned.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Thanks for the tip!
I'll keep that in mind
Sincerely Yours,
Brian Hart
|
|
|
|
|
I have my database called patients.mdb and I am using the below code to read from it (part of the code):
<br />
<br />
OdbcDataReader reader = command.ExecuteReader(); <br />
<br />
while (reader.Read())<br />
{<br />
rTxtBxMC.Text = Convert.ToString(<br />
reader[0]);<br />
} <br />
<br />
reader.Close();<br />
<br />
How to you write to a database of this type?
|
|
|
|
|
So you discovered one method (ExecuteReader) of the OdbcCommand class, and now you want someone to spoon feed you on another of its methods? too lazy to read a single page on MSDN? Google broke down? What gives?
|
|
|
|
|
Thanks for the answer, however just because something seems simple to you doesn't mean it will be to the next arrogent SB.
|
|
|
|