RE: add a column in oracle

2004-05-06 Thread Dave Carabetta
heh actually it confused me a touch.I believe that I understand what you're saying though I don't know what TOP type records are. Maybe I should specify my situation. I'm doing a WHAT'S NEW section of a web page.I want the 3 most recently entered items. I've adjusted my current query to my

RE: add a column in oracle

2004-05-06 Thread Jason.Gulledge
Close, and you shouldn't use select * from.. CFQUERY NAME=whatsnew DATASOURCE=dpch --change this from select * to whatever else select * from ( select * FROM whats_new WHERE dateAdded #dateAdd(d,-7,Now())# order by dateAdded DESC ) WHERE ROWNUM 4 /CFQUERY -Original Message-

RE: add a column in oracle

2004-05-06 Thread Jason.Gulledge
I think you may have it reversed.Work from the inside out. The sub select (or inner select) pulls back *every* row where dateadded sysdate-7 (by the way shouldn't you use dateadded =sysdate-7?) Then the outer select simply returns the first three rows from that. Jason Gulledge. -Original

RE: add a column in oracle

2004-05-06 Thread Dave Carabetta
Ah great thanks.I learned alot. So, let me re-iterate a bit. - The first select is the general search where I'm selecting 3 from the total and I list the columns that I want.I want all of them, but it's still better to directly list them both for readability and accuracy. - The second select is

Re: add a column in oracle

2004-05-05 Thread Howard Fore
I don't have my big red book handy, but isn't there a restriction in Oracle where you can add columns but not drop them (or vice versa)? -- Howard Fore, [EMAIL PROTECTED] On May 5, 2004, at 2:16 PM, Daniel Kessler wrote: I'm trying to add a column in my DB in Oracle.I'm doing: ALTER TABLE

Re: add a column in oracle

2004-05-05 Thread Howard Fore
As for your other question: SELECT TOP 3 FROM FOO -- Howard Fore, [EMAIL PROTECTED] On May 5, 2004, at 2:16 PM, Daniel Kessler wrote: I'm trying to add a column in my DB in Oracle.I'm doing: ALTER TABLE whatsnew ADD (imagevarchar2(100)); I also tried: ALTER TABLE whatsnew ADD column

Re: add a column in oracle

2004-05-05 Thread Gonzo Rock
Try putting quotes around the table and column names At 11:16 AM 5/5/04, you wrote: I'm trying to add a column in my DB in Oracle.I'm doing: ALTER TABLE whatsnew ADD (imagevarchar2(100)); I also tried: ALTER TABLE whatsnew ADD column imagevarchar2(100); but I get the error about line 4 of

Re: add a column in oracle

2004-05-05 Thread Howard Fore
Sorry, wrong database... SELECT * FROM foo WHERE rownum 4 -- Howard Fore, [EMAIL PROTECTED] On May 5, 2004, at 3:00 PM, Howard Fore wrote: As for your other question: SELECT TOP 3 FROM FOO -- Howard Fore, [EMAIL PROTECTED] On May 5, 2004, at 2:16 PM, Daniel Kessler wrote: I'm

RE: add a column in oracle

2004-05-05 Thread Dave Carabetta
I'm trying to add a column in my DB in Oracle.I'm doing: ALTER TABLE whatsnew ADD (imagevarchar2(100)); I also tried: ALTER TABLE whatsnew ADD column imagevarchar2(100); but I get the error about line 4 of the cfm.This is a reference to the text field from the form that contains the above line

Re: add a column in oracle

2004-05-05 Thread Dave Carabetta
Sorry, wrong database... SELECT * FROM foo WHERE rownum 4 Note that this will not work if you have any sort of ORDER BY clause because Oracle uses the rownum clause before the ORDER BY. This is why I posted the other way of doing SQL Server's version of TOP. Regards, Dave. [Todays Threads]

RE: add a column in oracle

2004-05-05 Thread Jason.Gulledge
Subject: Re: add a column in oracle Sorry, wrong database... SELECT * FROM foo WHERE rownum 4 Note that this will not work if you have any sort of ORDER BY clause because Oracle uses the rownum clause before the ORDER BY. This is why I posted the other way of doing SQL Server's version

Re: add a column in oracle

2004-05-05 Thread daniel kessler
Thanks everyone who replied.I have it working now. As for adding the column.It was the quotes that helped.yay! I'm trying to add a column in my DB in Oracle.I'm doing: ALTER TABLE whatsnew ADD (imagevarchar2(100)); I also tried: ALTER TABLE whatsnew ADD column imagevarchar2(100); but I get the