[Solved] Query to find letter P in database

Discuss the database features
Post Reply
jerc9024
Posts: 8
Joined: Wed Jun 05, 2024 6:24 pm

[Solved] Query to find letter P in database

Post by jerc9024 »

I am unable to execute database Query code can any one write me the code to find Letter P in my Data base :?:
Last edited by MrProgrammer on Mon Jun 17, 2024 9:19 pm, edited 2 times in total.
Reason: Edited topic's subject
OpenOffice 4.1.15 on Windows 11
UnklDonald418
Volunteer
Posts: 1566
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: I am unable to execute database Query code....

Post by UnklDonald418 »

Try

Code: Select all

SELECT * FROM "YourDatabaseTableName" WHERE POSITION ( 'P' IN "YourFieldName" ) > 0
The SQL function
POSITION ( <binary value expr 1> IN <binary value expr 2> )
The character and binary versions of POSITION search the string value of the second argument for the first occurrence of the first argument string. If the search is successful, the position in the string is returned as a BIGINT. Otherwise, zero is returned.
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