exists

EXISTS subquery causes error 1064

一个人想着一个人 提交于 2019-12-12 04:08:36
问题 since my last PLESK Update to 12.0.18 #70, I have a problem with phpMyAdmin using select statements with EXISTS subqueries . If I take simply the example from the MariaDB website (I tested it with real tables and fields on my DB): SELECT col1 FROM t1 WHERE EXISTS (SELECT * FROM t2) Quickly the interpreter underlines " EXISTS " and the " (SELECT " to show the error 1064 #1064 - You have an error in your SQL syntax; 1. unknown keyword (near "EXISTS" at position 30) 2. unexpected character (near

Check if file exists on FTPS site using cURL

纵饮孤独 提交于 2019-12-11 12:40:35
问题 I am using the cURL app to download multiple csv files. I want to find a way to check if the file exists on the ftps site before kicking off the download. If it doesn't exist I would like to find a way for cURL to check again at regular intervals. I am trying to stick to using cURL commands for this I am really not good at .Net programming. Any help would be appreciated 回答1: $ curl ftp://[host]/[path] --ssl --head (you might also need -k) --ssl: Try to use SSL/TLS for the connection --head:

Cakephp 3: How to ignore beforefind for specific queries?

大城市里の小女人 提交于 2019-12-11 09:37:02
问题 I am working on multilingual posts. I have added beforefind() in the PostsTable so I can list posts for current language public function beforeFind(Event $event, Query $query) { $query->where(['Posts.locale' => I18n::locale()]); } In order to allow users duplicate posts in different languages i wrote following function: public function duplicate(){ $this->autoRender = false; $post_id= $this->request->data['post_id']; $post = $this->Posts ->findById($post_id) ->select(['website_id', 'category

sql query to extract new records

≡放荡痞女 提交于 2019-12-11 08:26:36
问题 I have the following tables: CREATE TABLE Company ( CompanyUniqueID BIGSERIAL PRIMARY KEY NOT NULL, Name VARCHAR (150) NOT NULL ); CREATE TABLE Item ( ItemUniqueID BIGSERIAL PRIMARY KEY NOT NULL, CompanyUniqueID BIGINT NULL REFERENCES company DEFERRABLE INITIALLY DEFERRED, Name VARCHAR (150) NOT NULL, AddedDate TIMESTAMP without time zone DEFAULT now() ); In the life time of the application new companies and items are added to the tables. I wish to create an sql query that will select the

SQL Server : Issue in exists query replace with joins

北城以北 提交于 2019-12-11 07:28:42
问题 I am using the following code to fetch the report. DECLARE @CountryID smallint = 100 DECLARE @UTCTDIM smallint = 330 DECLARE @MarketProfileID smallint = 2 DECLARE @StartDate datetime = '2017-01-01' DECLARE @EndDate datetime = '2017-01-03' DECLARE @CustomerTypeID smallint = 1 SET NOCOUNT ON DECLARE @AirportList TABLE (ID bigint) INSERT INTO @AirportList (ID) SELECT DISTINCT Airport.ID FROM Airport INNER JOIN CityList ON Airport.CityID = CityList.ID INNER JOIN CountryList ON CityList.CountryID

MySQL > Table doesn't exist. But it does (or it should)

拥有回忆 提交于 2019-12-11 06:03:42
问题 I changed the datadir of a MySQL installation and all the bases moved correctly except for one. I can connect and USE the database. SHOW TABLES also returns me all the tables correctly, and the files of each table exists on the MySQL data directory. However, when I try to SELECT something from the table, I get an error message that the table does not exist. Yet, this does not make sense since I was able to show the same table through SHOW TABLES statement. My guess is that SHOW TABLES lists

BAT script to search directory for folders that match an input name

ぐ巨炮叔叔 提交于 2019-12-11 05:37:44
问题 not sure what's the best (or better ) way to write a bat script to take name input and search a directory to see whether it exists. do I need to output the directory list to a file first before running a comparison? and if it makes a difference, the directory is on a repository so for my purposes I'll be using 'svn list', but I thought a nice general solution for everyone would be nice. 回答1: If you are testing for a specific name within a directory, then you would generally do something like:

Applescript - creating a folder if it doesn't exist

与世无争的帅哥 提交于 2019-12-11 04:01:24
问题 Can someone please point out why this bit of Applescript isn't working? Thanks! on open droppedItems tell application "Finder" set inputFolder to (container of first item of droppedItems) as Unicode text if (exists folder ("converted") of inputFolder) then set outputFolder to (inputFolder & "/converted/") as text else make new folder at inputFolder with properties {name:"converted"} set outputFolder to the result as text end if end tell end 回答1: Here is another approach: mkdir -p will create

Python equivalent of Scala's exists() function?

心已入冬 提交于 2019-12-11 03:55:13
问题 Scala lists have an exists() function that returns a boolean if the list has an element that satisfies your predicate. Is there a way to do this in python that's just as clean? I've been using if next(x for x in mylist if x > 10): return Something Is there a better way? 回答1: Use any: if any(x > 10 for x in mylist): return Something You can complement this with all, and use not any and not all to round it out. Your way of using next will raise an exception if it doesn't find anything. You can

Using EXISTS as a column in TSQL

北城余情 提交于 2019-12-11 02:17:25
问题 Is it possible to use the value of EXISTS as part of a query? ( Please note : unfortunately due to client constraints, I need SQLServer 2005 compatible answers!) So when returning a set of results, one of the columns is a boolean value which states whether the subquery would return any rows. For example, I want to return a list of usernames and whether a different table contains any rows for each user. The following is not syntactically correct, but hopefully gives you an idea of what I mean.