I searched and didn't see this but I'll apologize if it's been asked.
Can there be any change that would allow for a value to be returned from a specific column and row? For example, PosgreSQL allows you to pass a row and column to the PQgetvalue() function to return the value at a specific location.
I mean, yeah, it can be programmed around and made so that you do each row in order and don't need to pass the row but it's nice to have the option (when the database supports it) to get the value from a specific row & column.
Database - Specific Row and Column Retrieval
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: Database - Specific Row and Column Retrieval
Using the reserved keyword of "rowid", I can use the following to go specifically to column 'mycolumn' in table 'mytable' in row 5 (if that's what you want?)
SELECT mycolumn FROM mytable WHERE rowid = 5
SELECT mycolumn FROM mytable WHERE rowid = 5
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: Database - Specific Row and Column Retrieval
Is that not SQLite only fangles?
I may look like a mule, but I'm not a complete ass.
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Re: Database - Specific Row and Column Retrieval
As far as I am aware (and it's been a while I admit), it works on MySql as well. Don't have it handy to test but I seem to remember that rowid was a reserved SQL keyword and not a reserved SQLITE keyword.srod wrote:Is that not SQLite only fangles?
But as I said, it's been a while.
I've been able to do this on old versions of MySQL (below) in the past to get a specific row (Don't know about now)..
SELECT mycolumn FROM mytable WHERE 5
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: Database - Specific Row and Column Retrieval
Oh, no. I meant after a query like SELECT * FROM customers. But rather than going one row at a time and getting just the columns for that row you can select (with a function and not a SQL statement) any row and column value at any time during the execution of the statement.
I believe SQLite and PostgreSQL can both do this. Well, I know PGSQL can and SQLite can with the table thing, I think.
I believe SQLite and PostgreSQL can both do this. Well, I know PGSQL can and SQLite can with the table thing, I think.