RE: SOT sql question

2008-01-09 Thread Mark Fuqua
Nuf said. I'll do it the right way. -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 09, 2008 1:12 PM To: CF-Talk Subject: Re: SOT sql question Mark Fuqua wrote: > I know I could do a another table with JobFileId's and Access levels,

Re: SOT sql question

2008-01-09 Thread Ian Skinner
Mark Fuqua wrote: > I know I could do a another table with JobFileId's and Access levels, instead > of a > list of access levels, but it seems cleaner this way. > It is not. You have denormalized your data in such away that doing the type of select you want to do is very difficult. If you

RE: SOT sql question

2008-01-09 Thread Mark Fuqua
the current users access level which is stored in #session.PlumUserRoles# Any idea how I might do that? Thanks, Mark -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 09, 2008 12:11 PM To: CF-Talk Subject: Re: SOT sql question On Jan 9, 2008 8:

Re: SOT sql question

2008-01-09 Thread Marco Antonio C. Santos
Mark, I'll like to suggest you to use DataMgr. DataMgr is a great time saver tool and could be the answer to your needs. http://datamgr.riaforge.org/ Cheers Marco Antonio C. Santos On Jan 9, 2008 2:56 PM, Mark Fuqua <[EMAIL PROTECTED]> wrote: > I think I need to be using 'IN' within my WHERE c

Re: SOT sql question

2008-01-09 Thread Charlie Griefer
On Jan 9, 2008 8:56 AM, Mark Fuqua <[EMAIL PROTECTED]> wrote: > I think I need to be using 'IN' within my WHERE clause but I can't seem to > get it to work. I have a column with a comma delimited list. This is the > latest attempt and it craps out too. > > SELECT.. > ...WHERE JobFileJob = #sessio

RE: SOT sql question

2008-01-09 Thread Will Swain
IN works the other way round I think - say you have a list of values and you want to pull all records with any of those values: WHERE name IN (will,john,ray) -Original Message- From: Mark Fuqua [mailto:[EMAIL PROTECTED] Sent: 09 January 2008 16:57 To: CF-Talk Subject: SOT sql question

SOT sql question

2008-01-09 Thread Mark Fuqua
I think I need to be using 'IN' within my WHERE clause but I can't seem to get it to work. I have a column with a comma delimited list. This is the latest attempt and it craps out too. SELECT.. ...WHERE JobFileJob = #session.jobId# AND '#session.UserRole#' IN (JobFileAccessLevel) Job

RE: SOT: SQL Question

2007-09-28 Thread Brad Wood
alk Subject: Re: SOT: SQL Question select t.order_num, t.product_name, t.datetime_created from test t, ( select order_num, max(datetime_created) maxdt from test group by order_num ) t2 where t2.order_num = t.order_num and t2.maxdt = t.datetime_created 1 query, but 2 selects = gets wh

Re: SOT: SQL Question

2007-09-28 Thread Greg Morphis
select t.order_num, t.product_name, t.datetime_created from test t, ( select order_num, max(datetime_created) maxdt from test group by order_num ) t2 where t2.order_num = t.order_num and t2.maxdt = t.datetime_created 1 query, but 2 selects = gets what you want On 9/28/07, Greg Morphis <[EM

Re: SOT: SQL Question

2007-09-28 Thread Greg Morphis
why do you have to use a single select statement? Thats pretty limiting there.. On 9/28/07, Brad Wood <[EMAIL PROTECTED]> wrote: > This one's been bugging me for a day now. I don't think this is > possible, but before I gave up I thought I would ask. (Yes Rick, I > googled it first) > > As usual

SOT: SQL Question

2007-09-28 Thread Brad Wood
This one's been bugging me for a day now. I don't think this is possible, but before I gave up I thought I would ask. (Yes Rick, I googled it first) As usual, the real scenario is much more complicated, but this is a simple example that shows the concept. Let's say I had a table with multiple

Re: SOT: SQL Question

2007-02-10 Thread James Holmes
Actually you can write an anonymous PL/SQL block inside a cfquery tag. There's a bug wherein line returns will cause an error in the JDBC driver, so the block must be all on one line, but it will work. Anyway, SUBSTR() will work like a right() function when -1 is used as the starting position: ht

Re: SOT: SQL Question

2007-02-10 Thread Dave Phillips
on.com [64.118.74.249] by mail.bizbreeze.com with SMTP; Sat, 10 Feb 2007 14:30:57 -0500 Received: from LOCALHOST by LOCALHOST with ESMTP id 4A591C6C01270B47B496A2614E792BB1 Sat, 10 Feb 2007 14:34:57 -0500 Subject: Re: SOT: SQL Question From: Jim Wright <[EMAIL PROTECTED]> Content-Type: text/p

Re: SOT: SQL Question

2007-02-10 Thread Jim Wright
Kris Jones wrote: > select case left(right(path,4),1) when '.' then right(path,3) else '' end > This will work on SQL Server (assuming all of your extensions are three characters), and possibly on Oracle(I think it now supports CASE). In your message you wanted a T-SQL solution, but said your

Re: SOT: SQL Question

2007-02-10 Thread Kris Jones
how about something that looks at the right 4 characters, and if the first of those 4 is a period, then get the right 3. I don't have SQL Server on this box, but it would be something like: select case left(right(path,4),1) when '.' then right(path,3) else '' end Again, don't have it in front of

SOT: SQL Question

2007-02-10 Thread Dave Phillips
Hey, I'm wondering if anyone would know T-SQL I could use to accomplish the following (I don't have the luxury of writing an SQL function for this, unfortunately): I have a column called 'path' in a database (Oracle) that has the following types of values in it: Example 1: c:\foldername\documen

SOT: SQL Question

2004-09-14 Thread Tangorre, Michael
Given the following: SELECT R.TEAMING_AGREEMENT_ID, R.ROUTE_GROUP_ID, B.BUSINESS_NAME, T.OPPORTUNITY_ID, D.DOCUMENT_NAME, D.DOCUMENT_EXTENSION FROM TEAMING_AGREEMENT_ROUTING R INNER JOIN TEAMING_AGREEMENT T   ON (R.TEAMING_AGREEMENT_ID = T.TEAMING_AGREEMENT_ID) INNER JOIN COMMUNITY_BUS

SOT: SQL QUESTION

2004-03-15 Thread Tangorre, Michael
SQL SERVER 2000 CFMX 6.1 I have three tables called: OPPORTUNITY, OPPORTUNITY_TEXT, TEXT_TYPE OPPORTUNITY_TEXT has two columns making the PK: TEXT_TYPE_ID and OPPORTUNITY_ID. In addition there is a column called OPPORTUNITY_TEXT_DATA which holds the actual text I am after [varchar(6000)]. What I

Re: SOT: SQL question (Resolved)

2004-02-23 Thread Cutter (CF-Talk)
ent: Monday, February 23, 2004 2:01 PM >   To: CF-Talk >   Subject: Re: SOT: SQL question > >   As listed in the original post, my ISP is using MySQL 3.23 (which has no >   support for union)... > >   Cutter > >   Ubqtous wrote: > >   > Cutter, >

Re: SOT: SQL question

2004-02-23 Thread Ubqtous
Cutter, On 2/23/2004 at 15:01, you wrote: CCT> As listed in the original post, my ISP is using MySQL 3.23 (which CCT> has no support for union)... The QoQ doesn't touch the database, rather it's using the record sets from the queries you run before hand. The query results are still in server mem

RE: SOT: SQL question

2004-02-23 Thread Mark A. Kruger - CFG
Yes but Query of queries DOES support the union key word. -Mark   -Original Message-   From: Cutter (CF-Talk) [mailto:[EMAIL PROTECTED]   Sent: Monday, February 23, 2004 2:01 PM   To: CF-Talk   Subject: Re: SOT: SQL question   As listed in the original post, my ISP is using MySQL

Re: SOT: SQL question

2004-02-23 Thread Cutter (CF-Talk)
As listed in the original post, my ISP is using MySQL 3.23 (which has no support for union)... Cutter Ubqtous wrote: > Cutter, > > On 2/23/2004 at 14:50, you wrote: > > CCT> **qEventList QofQ** > CCT> select  * > CCT> fromqHoliday, > CCT> qHoliday2

Re: SOT: SQL question

2004-02-23 Thread Ubqtous
Cutter, On 2/23/2004 at 14:50, you wrote: CCT> **qEventList QofQ** CCT> select  * CCT> fromqHoliday, CCT> qHoliday2 CCT> order bySDate maybe try this in your QoQ: select * from qHoliday union select * from qHoliday2 order by SDate ~ Ubqtous ~

Re: SOT: SQL question

2004-02-23 Thread Cutter (CF-Talk)
I've tried a query of query situation, but it is not returning all records from both tables, and I believe it may be because both tables have a key value that match. Here are my queries and the end results: **qHoliday** select h.intHolidayPlusID as ID, h.txtHolidayPlusTitle as Title, h

Re: SOT: SQL question

2004-02-23 Thread Ubqtous
Cutter, On 2/23/2004 at 14:07, you wrote: CCT> Ok, I'm back to this. Have an ISP who is using the outdated MySQL CCT> 3.23, which does not support Union statements in it's syntax. I CCT> need to combine the data of two separate but similar statements CCT> so that I may sort on a certain field. Th

SOT: SQL question

2004-02-23 Thread Cutter (CF-Talk)
Ok, I'm back to this. Have an ISP who is using the outdated MySQL 3.23, which does not support Union statements in it's syntax. I need to combine the data of two separate but similar statements so that I may sort on a certain field. These two tables are not Joined by any keys, though it could b

Re: SOT: SQL question

2004-01-06 Thread Jochem van Dieten
Cutter (CF-Talk) wrote: > 'last' = the last/most recent/highest autonumbered ID in the primary key > of the table. http://www.mysql.com/doc/en/Getting_unique_ID.html Jochem -- I don't get it immigrants don't work and steal our jobs  - Loesje [Todays Threads] [This Message] [Subscript

Re: SOT: SQL question

2004-01-06 Thread Cutter (CF-Talk)
'last' = the last/most recent/highest autonumbered ID in the primary key of the table. Cutter Jochem van Dieten wrote: > Cutter (CF-Talk) wrote: > >  > How do I get the ID of the last record in a table (mySQL db)? > > Define 'last'. > > Jochem > > -- > I don't get it > immigrants don't wor

Re: SOT: SQL question

2004-01-06 Thread Jochem van Dieten
Cutter (CF-Talk) wrote: > How do I get the ID of the last record in a table (mySQL db)? Define 'last'. Jochem -- I don't get it immigrants don't work and steal our jobs  - Loesje [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

SOT: SQL question

2004-01-06 Thread Cutter (CF-Talk)
How do I get the ID of the last record in a table (mySQL db)? Cutter [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: SOT: SQL question

2003-12-06 Thread Jochem van Dieten
Cutter (CF-Talk) wrote: > I have four (4) tables. One table holds IDs that reference info in the > other three (3) tables by ID. I am trying to pull the information for an > item, and pull the info specific to that item from the three tables. > What's wrong with this picture? > > select i.intB

SOT: SQL question

2003-12-06 Thread Cutter (CF-Talk)
I have four (4) tables. One table holds IDs that reference info in the other three (3) tables by ID. I am trying to pull the information for an item, and pull the info specific to that item from the three tables. What's wrong with this picture? select i.intBoutItemID as ID, c.txtBoutCat as C

Re: SOT: SQL Question - Could CF make this easier?

2003-06-17 Thread [EMAIL PROTECTED]
You can do it easier with SQL by using NOT IN ... WHERE Description NOT IN ('ANISE', 'APPLES',.) HTH Dick On Wednesday, June 11, 2003, at 11:37 AM, Jillian Carroll wrote: > I am creating a drop-down list of items, but I want to keep several > items > from appearing in the drop-down. >

SOT: SQL Question - Could CF make this easier?

2003-06-11 Thread Jillian Carroll
I am creating a drop-down list of items, but I want to keep several items from appearing in the drop-down. Is there a more efficient way to accomplish this (there will be several more exclusions): SELECT DISTINCT Description FROMVCT ORDER BY Description WHERE descriptio

SOT: SQL question

2000-10-05 Thread Chris Lott
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In a table something like this: userid, course john ethics john english mary english mary math mary bio I need to find a) which user has taken the most courses in total b) which course was taken the most often Ideas? c -