does TDengine support having clause in SQL? - database

as title, I need to use having function, I try to find the having grammar at https://tdengine.com/docs/en/v2.0/taos-sql
But I can't find any introduction to it, anyone knows?

Related

What does the function fn:data() do in exist-db?

I would like to know what the fn:data() function does in exist-db. I can't find the answer anywhere on the web.
It seems you have found one documentation of the data function, however, that is part of the MS SQL Server XQuery support.
In general, the W3C XQuery/XPath/XSLT functions are specified in https://www.w3.org/TR/xpath-functions/, so the data function in https://www.w3.org/TR/xpath-functions/#func-data.
Or use the eXist-db documentation if you want an eXist-db specific documentation, searchable at http://www.exist-db.org/exist/apps/fundocs/index.html: for the data function http://www.exist-db.org/exist/apps/fundocs/view.html?uri=http://www.w3.org/2005/xpath-functions&location=java:org.exist.xquery.functions.fn.FnModule&details=true#data.1
For the data function it might not matter but in general the "XQuery" support in non-XML databases like MS SQL is often not complete and/or not based on the current/latest spec so I would start with the W3C specification and then look at vendor specific documentation for the XQuery implementation in use instead of using third party documentation.
I just found the answer to my own question. If anyone else is wondering about this, you can find more here: https://learn.microsoft.com/en-us/sql/xquery/data-accessor-functions-data-xquery?view=sql-server-ver15

How to use Regex in a tsql query

I have a column called link, which can hold different types of link. I'd like to retrieve only those that have a urls, i.e. www.google.com, so that I can apply something.
SELECT *
FROM UserAlert
WHERE Link = ...// check whether it's a url
Thanks for helping
This is almost 100% likely to be a job better suited to the front-end application, not the database. It will require code execution on the server.
Here is a thread here on StackOverflow about url detection regexes, from which you can select any of a number of reasonably good expressions: What is the best regular expression to check if a string is a valid URL?
To use regexes in MSSQL, you need to first use MSSQL 2005 or later. Assuming that is the case... you have to wrap regex functionality in a custom CLR object, enable CLR interaction on your whole database, and then you can use that custom CLR object in your WHERE clause.
Here is a detailed article about doing exactly that with examples and step-by-step instructions.
I hope you're REALLY SURE that you want code execution to be part of your database. Good luck!

What do the Hints in Projection deploy script generated by Vertica Database Designer mean?

I have been searching the Vertica documentation for the meaning of certain hints in the deploy script generated by the Database Designer but have had no luck so far.
Some of the hints like +basename is kind of obvious.
But there is something called +createtype which is seen quite often in the auto-generated projection creation script. It looks like a function that takes in the following arguments, L and D.
Could any one shed some light on these cryptic hints?
I just want to to know if they are useful when creating projections manually.
Also let me know if there is any documentation from Vertica that would help me learn more on it.
I did post this question on both stackoverflow and at the Vertica Community-forums. The link leads to the answer. But giving a summary here:
Hints weren't intended to be used outside the DBD. Hence undocumented.
createType(L): if projection creation was delayed meaning the table was created, but waiting for data to be inserted into the projections
createType(D): if projection was created by Database designer
createType(P): if projections were created with the projection clause

Where are Predefined ORACLE PL/SQL Exceptions?

Where can I find Full list of all Predefined ORACLE PL/SQL Exceptions?
I have looked at that SQLCODE:-942 and SQLCODE:-02289 are exception code for sequence and table not existed. but whatever I cannot find any official document to explain the above two error code. so question is are these oracle Predefined exceptions? because I want to use the two error code to catch this two type exceptions.
You used the term 'exceptions', but it looks like you're asking about error code values, and specifically SQLCODEs. I'll try to answer both questions. :-)
To find the pre-defined exceptions defined in the database you can look in the package SYS.STANDARD. This is where the standard exceptions, such as NO_DATA_FOUND and TOO_MANY_ROWS, are defined. This is a good place to look if you're interested in trapping a specific SQLCODE as it might save you having to define a custom exception and initializing it with PRAGMA EXCEPTION_INIT.
To find a complete list of error code values, including SQLCODEs, compiler errors, etc, you should look in the version of the Oracle Database Error Messages manual for the database version you're using. In his reply above, #Mat gives a reference to the 11.1 manual. The 11.2 manual can be found here.
Share and enjoy.
The closest thing I could find is a 10g PDF. The only error codes list I could find for 11g is an HTML document. It's totally weird to me that neither list includes the ORA-00942 code, although it's pretty self explanatory.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14261.pdf , this is the Oracle database PL/SQL Language reference manual, look for predefined PL/SQL exceptions..

SQL Server Cursor Reference (Syntax, etc)

I don't use SQL Server Cursors often but when I do, I always have to look up the syntax and options.
So I wanted to ask, what is the best SQL Server Cursor reference on the web?.
I'm looking for a reference that explains all of the (major?) options (I.E. FAST_FORWARD) and also shows quick snippets of how to use it. (I.E. How to implement looping though a cursor and with a good practice for checking the ##FETCH_STATUS variable.)
Best Regards,
Frank
Quick Update: I'm looking for a balance of quick-reference but detailed enough to see my options. As an example. MSDN is a great reference guide but it has too much detail. The reference, ideally, should be concise.
Further update: I'm still looking for sources. If someone posts a good source that fits my criteria of concise, I will accept that answer...
How to Perform SQL Server Row-by-Row Operations Without Cursors:
http://www.sql-server-performance.com/articles/per/operations_no_cursors_p1.aspx
SQL Server Cursor Examples (with Cursor Alternatives):
http://www.mssqltips.com/tip.asp?tip=1599
I'd start out with the MSDN help page for cursors...
http://msdn.microsoft.com/en-us/library/ms180169.aspx
I always use the built in "Transact-SQL Reference" help within management studio. I find the examples on everything there to be more than enough for what I need.

Resources