110 Answered Questions for the topic SQL

Sql

22d

I have developed this but email goes blank but actualy there is data in the table?? below i have excluded try catch block

ALTER PROCEDURE [dbo].[spReportDataSync_log]ASBEGIN declare @last date = DATEADD(DAY, (DATEDIFF(DAY, 4, GETDATE()) / 7) * 7-7 , 4) declare @current date = DATEADD(DAY ,7, @last) DECLARE... more
Sql

10/23/19

Database Foundations

To maintain referential integrity, a foreign key value in one table of a relational database must match an attribute in another table.What is the name of the attribute?
Sql

09/11/19

SQL/Yardi Mentor

Does anyone have experience with SQL and Yardi?
Sql

09/01/19

show department name and no of employees against each department and manager name of each (also show departments with no employees).

i am using hr schema employees and departments tables.
Sql

07/12/19

How to execute raw SQL in SQLAlchemy-flask app?

How do you execute raw SQL in SQLAlchemy? I have a python web app that runs on flask and interfaces to the database through SQLAlchemy. I need a way to run the raw SQL. The query involves... more
Sql

07/12/19

How to perform OR condition in django queryset?

I want to write a Django query equivalent to this SQL query: SELECT * from user where income >= 5000 or income is NULL. How to construct the Django queryset filter? ... more
Sql

06/30/19

Structured data

Hi i am doing research about Structured data and I am not able to find significant information about Structured data.What are the different types of Structured data?What are the advantages and... more
Sql

06/28/19

List all movie titles and years in which Tommy Chong appeared (hint; sometimes the name column in the actor table contains multiple names, so you want to find any that contain this name)

List all movie titles and years in which Tommy Chong appeared (hint; sometimes the name column in the actor table contains multiple names, so you want to find any that contain this name)
Sql

06/19/19

General rules for simplifying SQL statements?

I'm looking for some "inference rules" (similar to set operation rules or logic rules) which I can use to reduce a SQL query in complexity or size. Does there exist something like that? Any... more
Sql

05/24/19

How to write a simple database engine?

I am interested in learning how a database engine works (i.e. the internals of it). I know most of the basic data structures taught in CS (trees, hash tables, lists, etc.) as well as a pretty good... more
Sql

05/19/19

Detect if value is number in MySQL?

Is there a way to detect if a value is a number in a MySQL query? e.g., `SELECT * FROM myTable WHERE isANumber(col1)=true`
Sql

05/18/19

MySQL "between" clause not inclusive?

If I run a query with a `between` clause, it seems to exclude the ending value. For example: select * from person where dob between '2011-01-01' and '2011-01-31' This gets all results with... more
Sql

05/17/19

Getting date in format 20 Mar 2018 (Tue)?

How can I display date as dd MMM yyyy (ddd) in SSRS? Thanks!
Sql

05/16/19

Difference between EXISTS and IN in SQL?

What is the difference between the `EXISTS` and `IN` clause in SQL? When should we use `EXISTS`, and when should we use `IN`?
Sql

05/15/19

Reporting Services - hide table column based upon report parameter?

I have a report in Reporting Services 2005, and I want to hide or show a single table column based upon a report parameter. Does anyone have any idea how to do that? Thanks!
Sql

05/15/19

How to find the last time a particular report was run?

I'm using SSRS 2016. I want to find out the last time a particular report was run. Is this something I can easily query on the ReportServer database? Thanks!
Sql

05/15/19

Calculate fiscal year in SQL Server?

How would you calculate the fiscal year from a date field in a view in SQL Server?
Sql

05/14/19

MYSQL Update Statement Inner Join Tables?

I have no idea what the problem is. Using MySQL 5.0 i get a compile error when attempting to run the following MYSQL update statement UPDATE b SET b.mapx = g.latitude, b.mapy =... more
Sql

05/14/19

Convert a string to int using sql query?

How to convert a string to integer using SQL query on SQL Server 2005?
Sql

05/14/19

How to find current transaction level?

How do you find current database's transaction level on SQL Server?
Sql

05/13/19

How to create composite primary key in SQL Server 2008?

I want to create tables in SQL Server 2008, but I don't know how to create composite primary key. How can I achieve this?
Sql

05/13/19

How can I customise error messages in SSRS?

I have SSRS Report being accessed from a Report Server. Is there any way I can give an error message of my own, if my report fails to open there?
Sql

05/13/19

How to return only the Date from a SQL Server DateTime datatype?

SELECT GETDATE() Returns: <code>2008-09-22 15:24:13.790</code> I want that date part without the time part: <code>2008-09-22 00:00:00.000</code> How can I get that?
Sql

05/12/19

IN vs OR in the SQL WHERE Clause?

When dealing with big databases, which performs better, `IN` or `OR` in the SQL `Where`-clause? Is there any difference about the way they are executed?
Sql

05/12/19

Use variable with TOP in select statement in SQL Server without making it dynamic?

declare @top int set @top = 5 select top @top * from tablename Is it possible? Or any idea for such a logic (i don't want to use dynamic query)?
1 3 4 5

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.