Solved

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

Posted on 2003-12-04
8
253 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
 
LVL 29

Expert Comment

by:leonstryker
ID: 9874305
I as well.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 54
VBA open file from excel cell 4 36
MS Date Picker 64 bit 32 bit issue 12 49
How to measure sizes and angles in scanned images ? 3 51
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

919 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now