Solved

how do i write a query in MSAccess/SQL/Oracle

Posted on 2003-12-04
8
255 Views
Last Modified: 2013-12-25
how do i write a query in MSAccess/SQL/Oracle to get  
RecordNumber/SrNo along with fields of one/multiple table

for example if my query returns Name & Age of person from table, i need Counting i.e. SrNo in a seprate field
SrNo   Name      Age
1        Austin     25
2        Kalis        45
3        Peter       35
0
Comment
Question by:nirmal_4194
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 8

Expert Comment

by:MYLim
ID: 9873146
1 12/04/2003 20 how do i write a query in MSAccess/SQL/O...  Unlocked VB Databases
2 11/11/2003 20 how to convert bmp file into PDF format ...  Unlocked Visual Basic
3 11/11/2003 20 sending email through VB  Unlocked Visual Basic
4 11/11/2003 20 how do i restrict user not to type more ...  Unlocked Visual Basic
5 11/01/2003 20 How do i print contents of multiline ric...  Unlocked Visual Basic
6 11/01/2003 125 how i can print data from mshflexgrid wi...  Unlocked Visual Basic
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9873234
Hi nirmal_4194:
Please finalise your other questions.
If you have not received reasonable answers, consider increasing the number of points.
(Suggested value of present question: 200 points)

Dabas
0
 
LVL 8

Expert Comment

by:MYLim
ID: 9873292
agree with Dabas :)
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 29

Expert Comment

by:leonstryker
ID: 9874305
I as well.
0
 

Author Comment

by:nirmal_4194
ID: 10024844
Yes, it was my mistake. now i have closed down all the qusetions except this one.
Can any one help me. I am increasing points too...
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 10024865
what do you mean by record number ?

in a database table there isn't  the concept of a physical sequence (normally exposed to the user anyway)

tell us what your table names are and the relationships between them...

 the Database systems you are interested in can be very different to actually write SQL for...

are you just wanting to interface to MS SQL Server and Oracle Databases from an MS Access Front end Database?
0
 

Author Comment

by:nirmal_4194
ID: 10051079
there is two table named Port_Master, Country_Master

Port_Code    Port_Name        Country_Code
AEDXB         DUBAI              AE
INMUM        MUMBAI            IN
USNYK         NEW YORK        US


Country_Code      Country_Name
AE                       U.A.E
IN                        INDIA
US                       U.S.A

Now I need port name along with country, and also serial number or record number i.e.

SrNo          Port_Name          Country_Name
1               DUBAI                U.A.E
2               MUMBAI              INDIA
3               NEW YORK          U.S.A

i need srno as a seprate field and not physical sequence number.
b'coz i need to write this query in my VB application to retrive data in recordset and i will assign this recordset to MSHFlexgrid.Datasource property.

I hope now you will get exact idea about my need.

thanks
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 75 total points
ID: 10057614
the general method in one statement would be

select count(*) as srno,P.Port_name, Country_name
from Port_master as P inner Join Port_Master as p1
on p.Port_code >= p1.port_code      -- this should be a >= test on the primary Key of the Port_master Table...
inner join country_master as C
on p.country_code = c.country_code
group by p.port_name,countru_name
order by 1 asc
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question