Yep, EXISTS will virtually always be faster, usually MUCH faster, than a
correlated subquery, because a subquery is evaluated for EVERY ROW processed
by the outer query.
On Wed, Aug 26, 2009 at 12:43 AM, Mark Henderson shadefro...@gmail.comwrote:
Brian Kotek wrote:
WHERE NOT EXISTS should
Mark,
What DBMS are you using?
If its SQL Server, I don't think what you want to do is possible other than
how you have already done it. If you find another way to do it (with a join)
I would also be interested to see that.
Kevin Roche
Kevin Roche wrote:
Mark,
What DBMS are you using?
If its SQL Server, I don't think what you want to do is possible other than
how you have already done it. If you find another way to do it (with a join)
I would also be interested to see that.
Kevin Roche
Hi Kevin,
Yes it's MS SQL.
Mark,
You might be right but I never got that to work myself, in MSSQL.
An experiment you might try is to do that subquery separately in a different
CFQUERY then plug in the retrieved value. Occasionally I have found that
knid of trick is quicker.
Kevin
On Tue, Aug 25, 2009 at 11:49 AM, Mark
Try using an OUTER JOIN and specify the criteria in the JOIN statement
...
FROM table1
LEFT OUTER JOIN table2
ON table1.col1 = table2.col1
AND {criteria goes here}
...
Thanks,
Mike
-Original Message-
From: Mark Henderson [mailto:shadefro...@gmail.com]
Sent:
Try this:
...
FROM
tbl_ForSaleCategories C
INNER JOIN (
tbl_RecentlyViewed RV
INNER JOIN
tbl_ForSale FS
ON RV.ID = FS.ID
)
ON C.ID = FS.Category_ID
LEFT JOIN
tbl_CoverSpecial CS
ON RV.ID = CS.ID
WHERE CS.ID IS NULL
AND FS.Active = 1
ORDER BY Date_Viewed ASC;
Thanks Billy and Michael (and Kevin). After some trial and error I
managed to stumble upon solution (the outer join gave me results but
not the expected set).
cfquery name=qGetRecentRecord datasource=#request.dsn#
SELECT TOP 1
RV.ID AS Rec_ID
,RV.Date_Viewed
,FS.ID
WHERE NOT EXISTS should also work.
On Tue, Aug 25, 2009 at 5:27 AM, Mark Henderson shadefro...@gmail.comwrote:
Greetings from the chilly south,
I have this query and it returns the expected result set, but I can't
work out how to use a join instead of the NOT IN clause and I *know*
that
Brian Kotek wrote:
WHERE NOT EXISTS should also work.
Yes it does, and I knew about that method when using NOT IN, as it was
a simple change to my original working query. What I didn't know, but
now do after some googling, is that NOT EXISTS means it uses an index
in the subquery as opposed
Basically, the cfset sqlToRun = ... / is kind of redundant and
negates the benefit of the cfquery tag. Put all you SQL inside the
cfquery tag. cfqueryparam is only valid within cfquery tags.
Dominic
2009/6/28 Jason Slack applesl...@gmail.com:
CF 8.01 OS X.
I have:
cfset sqlToRun = INSERT
[mailto:watson.domi...@googlemail.com]
Sent: Tuesday, June 30, 2009 5:22 AM
To: cf-talk
Subject: Re: SQL Help
Basically, the cfset sqlToRun = ... / is kind of redundant and
negates the benefit of the cfquery tag. Put all you SQL inside the
cfquery tag. cfqueryparam is only valid within cfquery
it's not good practice in ColdFusion to do this.
I don't agree with that : sometimes you have to do multiple updates, inserts or
else at the same time, depending on your process and some conditions; instead
of doing multiple cfquery (and thus multiple db connections), it is sometimes
cool
As Dominic said, putting the entire sql statement in as a variable in
ColdFusion isn't necessary.
Please, there IS a very good reason one would put an SQL statement in a
variable:
when using some tool to generate build queries for instance.
I have many examples in my own CMS, like a report
And with preserveSingleQuotes() you have to hope you're better at
cleaning input than hackers are at writing SQL injection. And yes, we
all know you're totally awesome at it; this response is for others
who'd rather not make that bet.
mxAjax / CFAjax docs and other useful articles:
[mailto:s...@emakina.com]
Sent: Tuesday, June 30, 2009 8:55 AM
To: cf-talk
Subject: Re: SQL Help
it's not good practice in ColdFusion to do this.
I don't agree with that : sometimes you have to do multiple updates, inserts
or else at the same time, depending on your process and some conditions
And with preserveSingleQuotes() you have to hope you're better at
cleaning input than hackers are at writing SQL injection.
When I'm talking about a CMS, I'm talking about some tool some customers
have paid for
and that is only accessible by approved users with authentication.
Now if they want
There's no reason you need a variable to do multiple updates in a
single query statement. You can still put the SQL inside the query
tags and, as you say, separate the statements with a semi-colon.
Scott
On Tue, Jun 30, 2009 at 6:55 AM, Stephane Vantroyens...@emakina.com wrote:
I don't agree
just use a stored proc and feed in the name.
-Original Message-
From: Scott Brady [mailto:dsbr...@gmail.com]
Sent: Tuesday, June 30, 2009 9:52 AM
To: cf-talk
Subject: Re: SQL Help
There's no reason you need a variable to do multiple updates in a
single query statement. You can still put
When I'm talking about a CMS, I'm talking about some tool some customers
have paid for and that is only accessible by approved users with
authentication.
Now if they want to hack and sabotage their own application they have
paid for, it's their problem, and if it ever happens, they will pay
Sure, as long as the CMS has no XSS attack points...
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/
2009/6/30 Claude Schneegans schneeg...@internetique.com:
And with preserveSingleQuotes() you have to hope you're better at
cleaning input than hackers are at
Internal security problems are far more common than external ones.
Within a large organization, not all users may be trustworthy.
C'mon, if they are users and they have access to the system, if they go
crazy,
do they really need SQL injection to harm the system ?
They can simply delete all
With SQL injection they can delete what they don't have access to.
With XSS they can do that while making it look like someone else did
it.
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/
2009/6/30 Claude Schneegans schneeg...@internetique.com:
Internal
With XSS they can do that while making it look like someone else did it.
Probably, but my clients barely know the difference between a computer
and a toaster,
and I spend more of my time explaining them that in order to press
Ctrl, they must find a key
on their keyboard with the letters Ctrl
Message-
From: Claude Schneegans [mailto:schneeg...@internetique.com]
Sent: Tuesday, June 30, 2009 11:19 AM
To: cf-talk
Subject: Re: SQL Help
With XSS they can do that while making it look like someone else did it.
Probably, but my clients barely know the difference between a computer
If you don't take security in mind when writing
applications it's just a matter of time before
something bad happens.
I can't tell you how many times I've been contacted by people who have had
their site broken and need an emergency fix. I've made quite a bit of money
fixing other people's
Also, you talk about this like your speaking of only internal
applications
or applications that could never go on a production environment.
Indeed, we were talking about building SQL queries in a variable inside
a Content management system.
Of course, for parts of the site exposed to public,
C'mon, if they are users and they have access to the system, if they go
crazy,
do they really need SQL injection to harm the system ?
They can simply delete all what they have access to, they can replace
content by porn, whatever.
Will CFQURYPARAM protect your application against that ?
if you're going to be generating your SQL like that, you'll need to wrap
your final variable in preserveSingleQuotes().
so...
cfquery name=addpersonaleventtome datasource=cf_WikiData
#preserveSingleQuotes(sqlToRun)#
/cfquery
it will be pointed out to you (possibly before I even finish
Right I am switching everything to cfqueryparam as I read about SQL injection.
Do you see my Invalid CFML construct found on line 22 at column 120.
above though? I still dont.
-Jason
if you're going to be generating your SQL like that, you'll need to wrap
your final variable in
A) Always use cfqueryparam/. (Note the period.)
B) When in doubt, use cfqueryparam/ anyways. (Note the period.)
C) While preserveSingleQuotes() can be a useful tool at times, I would have
a very difficult time thinking of a time where I would use it.
D) Always use cfqueryparam/. (Note again,
Just answered this on the SQL list:
http://www.houseoffusion.com/groups/sql/thread.cfm/threadid:855
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
I'm really greatful to you for the post.
Just answered this on the SQL list:
http://www.houseoffusion.com/groups/sql/thread.cfm/threadid:855
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Assuming your PK is named customerID you can do the following:
SELECT mytable.lastname, mytable.firstname, mytable.city, mytable.state
FROM mytable
WHERE mytable.customerID in (select min(customerID) from mytable group by email)
There is at least one problem in your query. The in () statement is
To view all your records with duplicate email addresses,
you might try something like this:
cfquery name=select_distinct_email datasource=dsn
select distinct email
from mytable
/cfquery
cfloop query=select_distinct_email
cfquery
On Tue, Sep 16, 2008 at 8:58 AM, Jeff F [EMAIL PROTECTED] wrote:
I've got a table (MySQL) with about 20k records. I'd like to be able to get
all fields from the table with distinct email addresses. Essentially, I'm
weeding out records with duplicate email addresses.
What I'm trying does not
# #state#br
br
/cfoutput
/cfloop
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2008 9:42 AM
To: CF-Talk
Subject: RE: SQL Help
To view all your records with duplicate email addresses,
you might try something like
Jim,
At first glance that seems to work, however the recordcounts appear to be off.
What I did was a simple query to find the total number of distinct email
addresses:
SELECT distinct mytable.email
FROM mytable
I get 19588 as a recordcount.
When I run
SELECT mytable.lastname,
On Tue, Sep 16, 2008 at 10:13 AM, Jeff F [EMAIL PROTECTED] wrote:
SELECT distinct mytable.email
FROM mytable
I get 19588 as a recordcount.
This number would include email addresses that are duplicated in the
table (but only a count of 1 for each distinct address).
SELECT
Thanks Jim. Now I see.
I guess what I'm looking for would be something like this then:
SELECT mytable.lastname,mytable.email
FROM mytable GROUP BY mytable.email HAVING distinct(mytable.email)
Which of course does not work. When there are records with duplicate emails
addresses, I need
Are the other fields in your table the same when the email is the same?
Meaning, are the records really duplicate? Or is it just the email that is
duplicate and the other fields may have varying values for two rows that
have the same email? If they do vary, do you care which of the duplicate
rows
When there are records with duplicate
emails addresses, I need to include one of them.
So you are trying to display one record for each email address?
You could try something like this. Not tested, but the idea is to select a
single PK for each email. Then use a JOIN to display the details
You could try something like this. Not tested, but the idea is to
select a single PK for each email. Then use a JOIN to display the
details for those PK's.
Note, the previous query assumes it does not matter which record is returned.
The records are from contest entries. People can only enter with one email
address. Some people entered multiple times, using the same email address.
I need to get a record set used to pick a winner, including just one of the
records from the duplicate email entries.
I need to get a record set used to pick a winner, including just one
of the records from the duplicate email entries.
If it does not matter which one, try the query I posted in my first response.
The syntax is not tested, but it has the right concept.
The records are from contest entries. People can only enter with one email
address. Some people entered multiple times, using the same email address.
I need to get a record set used to pick a winner, including just one of the
records from the duplicate email entries.
The records are from contest entries. People can only enter with one email
address. Some people entered multiple times, using the same email address.
So, why all the complexity with joins and subqueries? Just...
SELECT DISTINCT email FROM sometable
then pick a winner from the list of
It also begs the question, if they were only supposed to have one
entry
per e-mail address, why wasn't there error checking or a constraint on
the table to force this in the first place?
True enough. I was thinking the same thing myself ;-)
ok i go it i think
but it just looks so weird to me..
it looks back wards but works...
SELECT DISTINCT TOP 100 PERCENT dbo.V_riprod_ZMATMAST.sap_partnum AS NEQnumb
FROM dbo.V_riprod_ZMATMAST LEFT OUTER JOIN
dbo.V_riprod_Specs_ZMATMAST_EQ ON
no dice
cause it was 2am and didnt want to think about it no more
Dunno if this is right, just woke up, but I'll take a stab at it.
Looks like you need another join to the upsell table, then order by
its sort by column first.
SELECT brands.brand_id, brands.brand_name,
any good suggestions?
Dunno if this is right, just woke up, but I'll take a stab at it. Looks like
you need another join to the upsell table, then order by its sort by column
first.
SELECT brands.brand_id, brands.brand_name, brands.brand_logo,
products.product_id, products.brand_id,
Let me get this straight, you want a report to summarize the number of
installs by date and client. So client 1 ran 3 installs on 6/1 and 2
installs on 6/2.
I believe you simply need to group by hostname, and then date and then
use an aggregate function (count()) to add up the records in between
[EMAIL PROTECTED] wrote:
HostName, iDate, Package
client1, 2007-06-01, Update1
client1, 2007-06-01, Update2
client1, 2007-06-01, Update3
client1, 2007-06-02, Update5
client1, 2007-06-02, NewApp
client2, 2007-06-01, Update1
client2, 2007-06-01, Update2
client2, 2007-06-01, Update3
Subject: Re: SQL Help - Answered
I'm going to have to look at something. I'm still not getting what I
anticipated.
There are over 3700 records of which 1775 of them are distinct values
for RATE. However, I am only getting values of 1 for COUNT(DISTINCT
rate) as rateCount. I
You need a group by in your query..
SELECT count(DISTINCT rate) as rateCount, rate
FROMmyrates
WHERE my_code = 385 and year = 2005
GROUP BY rate
ORDER BY rate
On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Why do the first two queries work and the last one fail? The only
Thank you
Greg Morphis wrote:
You need a group by in your query..
SELECT count(DISTINCT rate) as rateCount, rate
FROMmyrates
WHERE my_code = 385 and year = 2005
GROUP BY rate
ORDER BY rate
On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Why do the
No problem, if you want to know why take a look at aggregate
functions, which is what count is, as well as others..
On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Thank you
Greg Morphis wrote:
You need a group by in your query..
SELECT count(DISTINCT rate) as rateCount, rate
I'm going to have to look at something. I'm still not getting what I
anticipated.
There are over 3700 records of which 1775 of them are distinct values
for RATE. However, I am only getting values of 1 for COUNT(DISTINCT
rate) as rateCount. I was trying to find out how many records are
can you provide a sample of your data and the way your table is
designed (column name, type)?
Thanks
On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I'm going to have to look at something. I'm still not getting what I
anticipated.
There are over 3700 records of which 1775 of them are
that and see if you're any closer to what you want.
-- Josh
- Original Message -
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Tuesday, April 03, 2007 2:09 PM
Subject: Re: SQL Help - Answered
I'm going to have to look at something. I'm still
Rick Root wrote:
I'm trying to figure out how to do something in SQL and I'm stumped.
I solved this problem with a view, and it works great.
Rick
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236815
Archives:
That probably needs to be
WHERE #idnumber# IN (MyColumn)
Ian,
Yes, I tried that. I had typoed my e-mail, but in my code I had the
parenthesis. That's what give the invalid comparison error. It doesn't seem
to recognize the field.
Dave
: Tuesday, August 16, 2005 4:37 PM
To: CF-Talk
Subject: Re: SQL help (updated)
You realize that this is essentially a db design issue - right? The
table shouldn't be holding lists of numbers - there should be a join
table that does that job. Right?
On 8/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED
To: CF-Talk
Subject: Re: SQL help (updated)
[EMAIL PROTECTED] wrote:
Okay, I still need help, but I've resolve part of my problem. I'm able now
to have the list of ID numbers in one field by themselves. So, my new field
value (MyColumn) looks like this:
'5,2,3,4,45,7'
I still need a way
Okay, I still need help, but I've resolve part of my problem. I'm able now to
have the list of ID numbers in one field by themselves. So, my new field value
(MyColumn) looks like this:
'5,2,3,4,45,7'
I still need a way using Query of Queries to extract only the records that have
the
SELECT *
FROM AllResults
WHERE #idnumber# in MyColumn
That probably needs to be
WHERE #idnumber# IN (MyColumn)
The values of an IN clause are supposed to be in parenthesis I believe. You
may also need to do something about the quotes if they are
[EMAIL PROTECTED] wrote:
Okay, I still need help, but I've resolve part of my problem. I'm able now
to have the list of ID numbers in one field by themselves. So, my new field
value (MyColumn) looks like this:
'5,2,3,4,45,7'
I still need a way using Query of Queries to extract only
You realize that this is essentially a db design issue - right? The
table shouldn't be holding lists of numbers - there should be a join
table that does that job. Right?
On 8/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Okay, I still need help, but I've resolve part of my problem. I'm able
and companyid in (select distinct companyid
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
-Original Message-
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]
Sent: Friday, June 03, 2005 10:20 AM
To: CF-Talk
Subject: SQL Help Please
I've
I've got a query that I just can't get right.
select *
From companies
where companyhide = 0
and companyid = (select distinct companyid
From releases where date_entered = DATE_SUB(curdate
(),INTERVAL 8 day) and date_entered = DATE_SUB
and companyid in (select distinct companyid
Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
That's it! I forget about in. I knew it was simple.
Thanks!
-jeff
-Original Message-
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]
Sent:
You've more or less posted the answer. The method to use would be:
INSERT INTO tblContactAddress(contactID,addressTypeID,address1, etc.)
SELECT #contactIDValue#, ID, '#address1Value#',etc.
FROM tblAddressType
WHERE typename = 'General'
Just make sure typename = 'General' will only return one
Oh, so IOW I can only do that for one join table, not more than one?
I have a couple of lookup columns that I'll be inserting...
Pete
On Apr 11, 2005 12:54 PM, Gareth Arch [EMAIL PROTECTED] wrote:
You've more or less posted the answer. The method to use would be:
INSERT INTO
You should be able to join as many tables as you like (just as in a regular
query). Just select the column names you need
insert into tblthis
(columnone, columntwo, columnthree)
select c.dataone, d.datatwo, e.datathree
from mycolumns c
inner join mycolumnstwo d on (c.my_id = d.my_id)
inner join
Subject: Re: SQL Help Needed
Okay, here's what I've come up with we'll see how it goes...
SELECT lanesID, subcategoryID, name, availability, price, srp, cost,
description
FROM dolls_backup
INSERT INTO tblProducts(ProdName, ProdDesc, ProdSRP, ProdPrice,
ProdCost, SubcatID)
VALUES
You'll have to check on the exact syntax, but something like this should work:
INSERT INTO myTable
(col1, col2, col3)
SELECT col4, col5, col6
FROM otherTable
The SELECT can be as complex as you want, as long as the columns it
returns are the same number and type as what is needed by the INSERT
Okay, here's what I've come up with we'll see how it goes...
SELECT lanesID, subcategoryID, name, availability, price, srp, cost, description
FROM dolls_backup
INSERT INTO tblProducts(ProdName, ProdDesc, ProdSRP, ProdPrice,
ProdCost, SubcatID)
VALUES (dolls_backup.name, dolls_backup.description,
On Friday 05 Nov 2004 21:00 pm, Eric Creese wrote:
lines is an int and this is MySQL Database. No issues with it in access or
sql server
Are those escaped ' meant to be there, or did it just happen when you pasted
into your mail client ?
What happens if you try the query by hand ?
also in
I am not sure by what you mean about escaping but that was the read out from
the error page.
SELECT * FROM p1_matrix WHERE display=apos;yesapos; AND lines = 1 ORDER BY
Charht ;
I have done this successfully with Access. I did notice that the datatype for
charht is decimal and for lines it
which db, what is the datatype of lines?
On Fri, 5 Nov 2004 14:34:46 -0600, Eric Creese [EMAIL PROTECTED] wrote:
Can some one please tell me why this does not work? If you pass the url.inch
variable it works fine. If you pass the url.line variable it fails with the
following error. code is
Subject: Re: SQL help needed fast
which db, what is the datatype of lines?
On Fri, 5 Nov 2004 14:34:46 -0600, Eric Creese [EMAIL PROTECTED] wrote:
Can some one please tell me why this does not work? If you pass the url.inch
variable it works fine. If you pass the url.line variable it fails
Microsoft SQL Server Help ... F1 ..
Unicode Data
Traditional non-Unicode data types in Microsoft(r) SQL Server(tm) 2000
allow the use of characters that are defined by a particular character
set. A character set is chosen during SQL Server Setup and cannot be
changed. Using Unicode data types,
PROTECTED]
Sent: Tuesday, August 10, 2004 12:23 PM
To: CF-Talk
Subject: Re: SQL help!
At 03:18 PM 8/10/2004, you wrote:
This is probably basic, but my brain is not functioning at this point
today...
I need to compare two tables. They both contain customer numbers. One table
mimics the other so
At 03:18 PM 8/10/2004, you wrote:
This is probably basic, but my brain is not functioning at this point
today...
I need to compare two tables. They both contain customer numbers. One table
mimics the other so the same data *should* be in each. It has come to my
attention that there are orphans
Quick and dirty .and it worked like a charm.. Thanks IN was where I
shoulda been looking...
Jeff
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2)
SELECT * FROM table2 WHERE id NOT IN (SELECT id FROM table1)
Yes, and may be UNION the two in one:
SELECT id FROM table1 WHERE id NOT IN (SELECT id FROM table2)
UNION
SELECT id FROM table2 WHERE id NOT IN (SELECT id FROM table1)
That union worked well too... thanks!
Jeff
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
Maybe I'm misunderstanding what you are trying to do, but try this
Select count(Referer) as refcount
From myTable
Where Referer = #myUserID#
Cutter
Dave Phillips wrote:
Hi guys,
I hope this isn't too far off topic, but I'm stuck on an SQL issue and
really need some help.
I have a
94% of it for you? -
http://honor.94percent.com
_
From: Cutter (CF-Talk) [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:31 PM
To: CF-Talk
Subject: Re: SQL Help Please?
Maybe I'm misunderstanding what you are trying to do, but try this
Select count(Referer) as refcount
From myTable
This is what you need ...
SELECT DISTINCT(referer), COUNT(referer)
FROM users
GROUP BY referer
-- Jeff
_
From: Dave Phillips [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:37 PM
To: CF-Talk
Subject: RE: SQL Help Please?
Unfortunately, that will only give me the number
% of it for you? -
http://honor.94percent.com
_
From: Jeff Chastain [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:39 PM
To: CF-Talk
Subject: RE: SQL Help Please?
This is what you need ...
SELECT DISTINCT(referer), COUNT(referer)
FROM users
GROUP BY referer
-- Jeff
_
From: Dave Phillips
You are filtering on the enrollment table. This makes the left outer
join useless.
Try doing :
WHERE e.EnrollmentDate BETWEEN '#fromDate#' AND '#toDate#'
ORe.EnrollmentDate IS NULL
And of course (Guess what or look at some other threads right now)
-Original Message-
From:
yeah yeah, the cfqueryparam, i pulled this from SQL Analyzer, it chokes for some reason on that... :-)
thanks, i'll check this out.
JOhn
-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 2:12 PM
To: CF-Talk
Subject: RE: SQL Help
You
Ascension day.
-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: vrijdag 21 mei 2004 3:07
To: CF-Talk
Subject: RE: SQL HELP!
what holiday?
tony
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
SELECT stuff.*, person1.*, person2.*, person3.*
FROM(
(
stuff LEFT JOIN persons AS person1 ON stuff.first_person_id =
persons.person_id
) LEFT JOIN persons AS person2 ON stuff.second_person_id = persons.person_id
) LEFT JOIN persons AS person3 ON stuff.third_person_id = persons.person_id)
What if I wanted to add a WHERE clause?
- Original Message -
From: Matthew Walker
To: CF-Talk
Sent: Thursday, May 20, 2004 1:28 AM
Subject: RE: SQL HELP!
SELECT stuff.*, person1.*, person2.*, person3.*
FROM(
(
stuff LEFT JOIN persons AS person1 ON stuff.first_person_id
AS person3 ON stuff.third_person_id =
persons.person_id
WHERE ... (your where clause here)
-Original Message-
From: brobborb [mailto:[EMAIL PROTECTED]
Sent: donderdag 20 mei 2004 9:07
To: CF-Talk
Subject: Re: SQL HELP!
What if I wanted to add a WHERE clause?
[Todays Threads
hey peter may i contact you off the list quick?
- Original Message -
From: Pascal Peters
To: CF-Talk
Sent: Thursday, May 20, 2004 4:22 AM
Subject: RE: SQL HELP!
Just add it after the FROM clause. Also keep in mind that if you use
all * in the SELECT clause, you won't be able to access
From: brobborb
Now I want to return all the rows in the STUFF table, but to
replace the last 3 fields with names in the PERSONS table.
THe fields first_person_id, second_person_id, and
third_person_id links to the person_id field in the table
PERSONS.
A good book to have on your desk
Maybe too late, but you can. It's a holiday in Belgium, so I don't read
my mail as often as on a work day.
Pascal
-Original Message-
From: brobborb [mailto:[EMAIL PROTECTED]
Sent: donderdag 20 mei 2004 11:24
To: CF-Talk
Subject: Re: SQL HELP!
hey peter may i contact you off
what holiday?
tony
Tony Weeg
sr. web applications architect
navtrak, inc.
[EMAIL PROTECTED]
410.548.2337
www.navtrak.net
-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 20, 2004 11:19 AM
To: CF-Talk
Subject: RE: SQL HELP!
Maybe too late
1 - 100 of 255 matches
Mail list logo