473,324 Members | 2,511 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,324 software developers and data experts.

Selecting columns by number

Hi,
is it possible to SELECT a column by number rather than name? I can't find
this anywhere in the manual.
It's for a generalised function on a set of tables with different fieldnames
where I always want to select values by the value of the first field.
TIA
Tony
Jul 19 '05 #1
2 2635

"TonyMJ" <to**@nospam.jantony.co.uk> wrote in message
news:Cq**************@stones.force9.net...
Hi,
is it possible to SELECT a column by number rather than name? I can't find
this anywhere in the manual.
It's for a generalised function on a set of tables with different fieldnames where I always want to select values by the value of the first field.
TIA
Tony


I actually read this just recently in my MySQL book but I've not tried it -
I believe you can, and columns start at 1 (being the leftmost column).

But becareful because if you later alter your table, or have a script that
creates the table with columns in a different order, you could end up
getting your twists in your knickers...

What have you got against using the column names? It will help you alot
if/when you, or someone else has to modify your code in the future...

randelld
Jul 19 '05 #2

"TonyMJ" <to**@nospam.jantony.co.uk> wrote in message
news:Cq**************@stones.force9.net...
Hi,
is it possible to SELECT a column by number rather than name? I can't find
this anywhere in the manual.
It's for a generalised function on a set of tables with different fieldnames where I always want to select values by the value of the first field.
TIA
Tony


I actually read this just recently in my MySQL book but I've not tried it -
I believe you can, and columns start at 1 (being the leftmost column).

But becareful because if you later alter your table, or have a script that
creates the table with columns in a different order, you could end up
getting your twists in your knickers...

What have you got against using the column names? It will help you alot
if/when you, or someone else has to modify your code in the future...

randelld
Jul 19 '05 #3

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

Similar topics

5
by: Axial | last post by:
Question: How to select columns from Excel-generated XML when some cells are empty. I've found examples where rows are to be selected, but I can't seem to extrapolate from that to selecting...
3
by: Joakim Olesen | last post by:
Hi I have an issue with an asp page that reads from an Excel file. I read the file using OLEDB. I create a new Excel file using "MS Excel 2003" and put the following data into a sheet called...
4
by: Doslil | last post by:
I have a form which has a subform.In the main form I have only one field (this is a drop down list and has a query attached to it) which selects empno,Name from the EmployeeInformation table. ...
6
by: aaj | last post by:
Hi all I use a data adapter to read numerous tables in to a dataset. The dataset holds tables which in turn holds full details of the records i.e. keys, extra colums etc.. In some cases I...
2
by: Will Newton | last post by:
I have attached some SQL which produces what to me, at least, is rather unexpected results. Selecting real columns into double precision columns loses some precision. Is this expected or documented...
0
by: | last post by:
I am testing the following piece of code: Is it possible to list the row number containing the checked box? After checking the desired box, I would want a message box to popup listing the row...
2
by: Catch_22 | last post by:
Hi, I have a stored procedure that has to extract the child records for particular parent records. The issue is that in some cases I do not want to extract all the child records only a...
1
by: Xh | last post by:
Hi All, I'm using DB2 v9 Express-C - I have problem when selecting XML columns. I have 2 columns in patients table: - id_patient - patient_info select * from patients;
2
by: johnjr | last post by:
I'm trying to select two rows from two columns and while I can select the columns, the selection of multiple rows is not falling into place. I can pull one row into the report, but not two. This...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.