I want to show a single row

Creating tables and queries
Post Reply
AbdulHaseeb
Posts: 1
Joined: Tue Jan 31, 2023 7:11 pm

I want to show a single row

Post by AbdulHaseeb »

I want to show a single row completely but i want it to use only Select From Where
OpenOffice 3.1 on Windows
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: I want to show a single row

Post by Villeroy »

Code: Select all

SELECT * 
FROM "Table"
WHERE "Identifier" = :Please_Enter_ID
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: I want to show a single row

Post by UnklDonald418 »

You didn't provide any information about what type of database you are using.
To limit the result set to one row for many databases you could add

Code: Select all

AND ROWNUM() = 1
to your WHERE clause.
If you are using an Embedded Base database

Code: Select all

SELECT TOP 1 * FROM "YourTable"  WHERE whatever constraints you have.
This query must be run in the direct mode, the Base parser will reject that statement. In the direct mode you must specify all the elements in the WHERE cause.you cannot use a parameter query like the one recommended by Villeroy.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply