Difference between revisions of "Select"

From wikieduonline
Jump to navigation Jump to search
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 +
select
 +
[[select count]]
 +
[[select distinct]]
  
  
[[PostgreSQL]]:
+
[[PostgreSQL select|PostgreSQL]]:
* <code> select * from your_table_name</code>
+
* <code> select * from your_table_name;</code>
 +
* <code> select * from your_db.your_table_name;</code>
 +
* <code>[[SELECT * FROM pg_stat_activity;]]</code>
 +
* <code>[[SELECT version();]]</code>
 +
* <code>[[SELECT current user;]]</code>
 +
* <code>[[SELECT current database();]]</code>
 +
 
  
 
  SELECT * FROM your_table_name;
 
  SELECT * FROM your_table_name;
 
  [[ERROR: permission denied for table]] your_table_name
 
  [[ERROR: permission denied for table]] your_table_name
  
[[SELECT version();]]
+
 
  
 
* <code>[[select]] current_setting('[[block_size]]');</code>
 
* <code>[[select]] current_setting('[[block_size]]');</code>
Line 15: Line 24:
 
* [[MySQL]]: <code>[[select user]] FROM [[mysql.user]];</code>
 
* [[MySQL]]: <code>[[select user]] FROM [[mysql.user]];</code>
  
 +
 +
[[jq]]:
 
* <code>[[jq]] '.[] | [[select]](.color=="blue")' your_json_file.json</code>
 
* <code>[[jq]] '.[] | [[select]](.color=="blue")' your_json_file.json</code>
 +
* <code>cat file.txt | jq '.Quotas[] | select(.QuotaName | [[contains]]("G and VT")) | {QuotaName, Value, QuotaArn, QuotaCode, Unit}'</code>
 +
 +
  
 
== Related terms ==
 
== Related terms ==
 
* [[MongoDB]]: <code>db.YOUR_COLLETION_NAME.[[find]] ()</code>
 
* [[MongoDB]]: <code>db.YOUR_COLLETION_NAME.[[find]] ()</code>
 
* <code>[[select count]]</code>
 
* <code>[[select count]]</code>
* <code>[[GRANT]]</code>
+
* <code>[[select distinct]]</code>
 +
* <code>[[GRANT SELECT]]</code>
 +
**<code>[[GRANT SELECT ON ALL TABLES]]</code>
 +
* <code>[[ERROR: permission denied for relation]] your_table</code>
 +
* [[SELECT can cause synchronous writes on the disk]]
  
 
== See also ==
 
== See also ==
 +
* {{SELECT}}
 
* {{SQL}}
 
* {{SQL}}
  
 
[[Category:Computing]]
 
[[Category:Computing]]

Latest revision as of 14:20, 22 May 2024

select 
select count
select distinct


PostgreSQL:


SELECT * FROM your_table_name;
ERROR: permission denied for table your_table_name




jq:

  • jq '.[] | select(.color=="blue")' your_json_file.json
  • cat file.txt | jq '.Quotas[] | select(.QuotaName | contains("G and VT")) | {QuotaName, Value, QuotaArn, QuotaCode, Unit}'


Related terms[edit]

See also[edit]

Advertising: