473,395 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Equivalent of MS Access Sql (first or last function) in oracle9i

I have a table in MS Access and ran a query to return some distinct record, it works fine but a similar table in Oracle 9i using similar query (sql) failed. Find below the MS Access Orignal table, Access Query (sql), and table after rurnning query and the error returned while trying to run same query on Oracle 9i:

Access Orignal table
Name Add Category Bala
ATM 12, OREMEJI STREET A1 LL
ATM1 3, BANA ROAD A3 QQ
ATM 5, BADORE A111 AC
ATM 6, SHOLA STREET A23 AA
ATM1 67, BANA AVENUE A9 BB
ATM2 45, KADOZO A12 WE
ATM3 13, HALIMAT A87 GG
ATM3 23, KAMARA A8 XX
ATM1 78, BOUNCERS A5 TT
ATM2 35, KUDIRAT ABIOLA WAY A2 WE

Access Query (sql)

SELECT DISTINCT ATM.Name, FIRST(ATM.BALA) AS BALA, FIRST(ATM.ADD) AS ADDRESS
FROM ATM
GROUP BY NAME;


table after rurnning query
Name BALA ADDRESS
ATM LL 12, OREMEJI STREET
ATM1 QQ 3, BANA ROAD
ATM2 WE 45, KADOZO
ATM3 GG 13, HALIMAT

error oracle 9i
ORA-00904: "LAST": invalid identifier
Nov 28 '07 #1
3 9203
prty
3
Please use this query :
Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT DISTINCT ATM.Name, ATM.BALA AS BALA, ATM.ADD AS ADDRESS
  3. FROM ATM
  4. GROUP BY NAME,BALA,ADDRESS;
  5.  
  6.  
Dec 12 '07 #2
amitpatel66
2,367 Expert 2GB
Are you sure you ran the same query as above in your oracle 9i??
Dec 12 '07 #3
QVeen72
1,445 Expert 1GB
Hi,

Not very sure "First" and "Last" can be used directly without Dense_Rank.

Anyway, if you are Interested with any one of the Names from the List, you can use "Min" or "Max" functions..

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT ATM.Name, Min(ATM.BALA) AS BALA, Min(ATM.ADD) AS ADDRESS
  2. FROM ATM
  3. GROUP BY ATM.NAME
  4.  
Regards
Veena
Dec 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
3
by: David MacKay | last post by:
Dear Greater Py, <motivation note="reading this bit is optional"> I am writing a command-line reader for python. I'm trying to write something with the same brevity as perl's one-liner ...
2
by: Andrew Poulos | last post by:
A friend of mine has built as simple site for use on his company's intranet. It uses JavaScript to read comma-delimited information from a text file and displays it in tabular form. When I...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
35
by: lnatz | last post by:
Hi, Is there an equivalent to the perl command chomp in C? And if there is no exact equivalent command, how would I go about removing the "\n" at the end of a stdin? Thank you, Natalie
4
by: rick | last post by:
hi Is there a DB2 equivalent of Informix.Extend function? or please help me the best way to create one Thanks rick
9
code green
by: code green | last post by:
I want to compare two text fields and return records where they differ. But I need to ignore the last 15 characters of the first string. Is there an equivalent to this function in Access ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.