Skip to content

Hive Insert Overwrite Table

I’m new to Hive and I wanted to know if insert overwrite will overwrite an existing table I have created. I want to filter an already created table, let’s call it TableA, to only select the rows where …

last quarter and next quarter

I would like to get the dates for the last quarter and next quarter. I have tried: SELECT convert(date, DATEADD(q, DATEDIFF(q,0,GETDATE()) -1 ,0)) FirstQDate, convert(date, DATEADD(s,-1,DATEADD(q, …

Random and duplicates with order by?

Suppose I have a table like so, What I need to do, is randomize this SELECT query, but in a very two particular ways that I just can’t figure out how to do. Firstly, I want unique_data randomized, so that the SELECT query could return something like (randomly): The second requirement I have is that, uni…

Import Data into Excel from Access Table

I am trying to import data into Excel from an Access table. I am getting a syntax error This error comes up when I run the line: Select [Time], [Tank], FROM “UnitOneRouting”, WHERE [Date] = ” & RpDate & ORDER BY Tank, Time”, cn, adOpenStatic, adLockOptimistic, adCmdTable In the…

dbms_metadata.get_ddl not working

I want to get the DDL of Table CARD_TABLE in XT schema But my select Query works I queried dba_objects it still got the table: Answer From the dbms_metadata documentation: If nonprivileged users are granted some form of access to an object in someone else’s schema, they will be able to retrieve the gran…

Creating EVENTS in SQL Server

I want to execute a query at a specific time. In MySQL we use events for that, example is as follows: CREATE EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO UPDATE …