• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: SQL – FIlter out field names

Resolved: SQL – FIlter out field names

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Is there a way to get only the value from the Select Query and not the field name?
Ex:
db=> select url from file where owner='abc' AND name='xyz';

                           url                           
---------------------------------------------------------
 /abc/xyz.com

(1 row)
I just need ‘/abc/xyz.com’ and not url and (1 row)
Is there a filter I can use in the Select command itself? if not, could you please suggest me other options?

Answer:

In psql interactive mode, you can switch to “tuples-only” mode with the meta-command \t. The manual:

\t Toggles the display of output column name headings and row count footer. This command is equivalent to \pset tuples_only and is provided for convenience.


The same is available as option -t for non-interactive mode. The manual:

-t –tuples-only Turn off printing of column names and result row count footers, etc. This is equivalent to \t or \pset tuples_only.


If you have better answer, please add a comment about this, thank you!

database postgresql psql select sql
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Resolved: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed. cors error not resolving

02/04/2023

Resolved: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘crm.email’ doesn’t exist (Connection: mysql, SQL: select count(*) as aggregate from `email`

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.