teradata assistant returned <Error> for simple select query - sql

I run a simple query in our company's teradata sql assistant and it returned a records with mostly "".
It's a very simple select query, like select top 100 * from tablename.
I used a different computer to run the same query and got valid results.
Any thoughts?

Related

Get last executed query id in SINGLESTORE

Is there any way to get the last query id executed in Singlestore?
I need a query that returns the identifier of the last query that was executed.
In SingleStore you can query the MV_PROCESSLIST in the information_schema database (SELECT * FROM information_schema.mv_processlist) or you can use the SQL query SHOW PROCESSLIST.
You will be able to see queries ID.

SQL Server 2012 Management Studio not returning more than 10,000 rows

I am running a simple query like
SELECT *
FROM [LyncConversationDetail].[dbo].[MessageDetails]
WHERE ProjectId = '13'
but I am not getting more than 10,000 rows as a result, not sure what am I missing here as I don't have much knowledge in this. Is there any SQL Server setting for max row count? Or is it dependent on something else?
Try to check how many rows is in Your table.
SELECT count(*)
FROM [LyncConversationDetail].[dbo].[MessageDetails] where ProjectId='13'

comparing results from live and test servers in sql

here is my situation.
I have 2 databases which is a live and test database, the live is updated with data and the test database has data one month later than the live.
so i am simulating the work flow which has been processed in the live database and found many discrepancies.
let say i run this query
use liveDB select * from tblA
the result would produce 100 results
then
use testDB select * from tblA
the result would produce 300 results
any ideas sirs?
The test database is not being added to correctly or items have been removed from the live db. Check your code where the data is taken from the live to the test. Maybe you have duplicate entries. Try the following and see what you get:
use liveDB select DISTINCT * from tblA
use testDB select DISTINCT * from tblA
Maybe if you are selecting entries from the live based on a datetime where clause, the datetime is not being interpreted correctly. SQL may be reading the datetime in US format instead of Europe of vise-versa. If you are specifying a datetime as a string try using yyyy-mm-dd format so that the month and day do not get unintentionally switched around

Query a union query

First of all I know this is probably bad sql but I just need to run a few queries of this and it will not go into official use anywhere.
I need to find some records from the fcc uls database so I got the tables and they have one table with locations and one with frequencies for a number of categories. So what I've done is run queries to join the location and frequency tables each category and the run a union query on these to get all the records in one table.
Now I want to run a query on the union query to pull up records that only match certain coordinates but I keep getting a the error "Syntax error (missing operator) in query expression '(All.latd)'" Is there anyway to actually run a query on a union?
SELECT (All.latd), (All.latm), (All.lats), (All.lond), (All.lonm), (All.lons), (All.freq)
FROM All
WHERE (latd =37) AND (latm=53) AND (lond=76) AND (lonm=37);
All is a reserved word, you need square brackets.
SELECT [All].latd, [All].latm, [All].lats, [All].lond,
[All].lonm, [All].lons, [All].freq
FROM [All]
WHERE latd =37 AND latm=53 AND lond=76 AND lonm=37;

Query between SQL server and Client side

I create a query: Select * from HR_Tsalary where month='3' and year ='2010' the result is 473 records and I found 2 duplicate record, then I create another query to find duplicate record only: SELECT Emp_No, COUNT() FROM HR_Tsalary WHERE year = '10' AND month = '3'GROUP BY Emp_No HAVING COUNT() > 1 the result is zero record from client side (thru Visual Basic Adodb code). But when I use same query from server the result is 2 records. Is there any different when create a query between from server side and client side?
You could start SQL Server Profiler then run your VB code, and see the exact query that's hitting the database and make sure it is what you're expecting.
-Krip
SQL server profile is always open also I identified that from client side some functions are working such as select, order by but some functions are not working such as group by, sum, count, having