
[Solved] Query to find letter P in database
[Solved] Query to find letter P in database
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
Reason: Edited topic's subject
OpenOffice 4.1.15 on Windows 11
-
- Volunteer
- Posts: 1566
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: I am unable to execute database Query code....
Try
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.
Code: Select all
SELECT * FROM "YourDatabaseTableName" WHERE POSITION ( 'P' IN "YourFieldName" ) > 0
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
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11