473,395 Members | 1,454 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.

a counter in a select statement

How do I get a counter in a select statement output

Say if I do
Select counter, col1, col2 from table1

The output should be

Counter Col1 Col2
1 val11 val21
2 val12 val22
3 val13 val23
4 val14 val24

Sep 21 '05 #1
1 3680
Hi guy,

This is a possibility:

select count(*) recnum, a.naam, a.voornaam
from persoon a
inner join persoon b
on a.p_persoon >= b.p_persoon
GROUP BY a.naam, a.voornaam
ORDER BY recnum

Greetz,

Karel

Sep 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Brearley | last post by:
I have a counter (alright one I found on asp101.com) that checks for a session variable to prevent the counter from incrmenting if a user refreshes the page or returns to the page during the same...
6
by: Who.Really.Really.Cares | last post by:
Hi! I guess this must be a FAQ but I'll give it a try. I've searched the web and usenet archive and found only negative answers. But most of them were dated like 3-4 years back. Hasn't anything...
5
by: alan_atwood | last post by:
I am looking to produce a query that will in addition to displaying the data will generate a counter that will be incremented by one with each row of the resultset. For example, my resultset would...
1
by: Sam Collett | last post by:
I am looping through a table to get the number of replies to a post on a discussion system. 'posID' is the primary key (i.e. thread id), 'posParent' is the parent thread. However, it only seems to...
1
by: Drew | last post by:
I would like to find out how to build a click counter using VB.NET. This is not a run-of-the-mill click counter (i.e. for web use), but a novelty app that counts how many times you click...
1
by: SQLGuy | last post by:
How do I get a counter in a select statement output Say if I do Select counter, col1, col2 from table1 The output should be Counter Col1 Col2 1 val11 val21 2 val12 ...
3
by: cachaco87 | last post by:
Hi, I'm new to this boards, and I need some help finishing a project for school. Im using nested if-statements inside a while loop to execute different actions. action C consist of printing the...
3
by: Abhinavnaresh | last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
2
by: gumbercules | last post by:
I am designing a site that is regulary updated with new podcasts. I would like to be able to have a counter next to each podcast showing how many hits/listens/plays/views each particular podcast has...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.