I have a table called person in my database. I want to add another column to the same table and it’s a Boolean datatype column. I have tried following queries but it says syntax error near default. I …
How do I get a space in my property name?
I have the following query: The problem is that I make the property ProjeAdı in the Select clause. I want the property to match the sql column, Proje Adı (note the space). How can I do that? Answer aliases cant have spaces between them , just like any variable name cant have white space, they are considered as bad naming
Propel adds CROSS JOIN to query when using an alias to JOIN tables
Trying to do a fairly simple query in Propel 2. I have a Person table and a Possession table – persons can have many possessions but only one of each possession type. So a person can have 1 book, 1 car, etc. I’m trying to write a query in Propel that will return all persons along with their car name
Can we write case statement without having else statement
I have this query: It is giving me o/p as Id A B NULL NULL NULL I don’t want to have NULL values in my output, I only want to compare in A and B, is it possible in case statement. Answer A case expression can only manipulate the value of an expression, not remove rows from the result. If
sql SUM: change null with 0
I have a query like this: And another like this: I want to select from those tables, with condition But I also want to change the null record which appears with 0, I’ve tried COALESCE but it still doesn’t give me the right result. Answer In general you would first set NULL values to 0 and then SUM them: Otherwise
T-SQL sort integer values
I’d like to create a procedure which later will have 5 integer parameters as an input. Within these procedure I want to sort those integer values in ascending order and later update a table. I did it …
import from excel to sql server: The ‘Microsoft.ACE.OLEDB.12.0’ provider error
I want to import data from excel to sql server, but I got error: The ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine. op: windows 10 64 bit excel: 32 bit There is no …
what is the difference between Coalesce and nullif
I am currently working on an SSRS report that will need to display a Dr’s ID based on either their DEA number or NPI number. I need to be able to do a coalesce on DEA and NPI to find the non-unknown one, which I will then add code to the SSRS report that will display a hover over stating
How to fold table rows with duplicated ID’s in T-SQL
I’ve googled for a while but haven’t found an aswer so I request your help. I have a subquery which returns me these values: And I need to make it look like this: Answer
Table shows DISTINCT information when I tell it not to?
For some reason I keep getting an output with DISTINCT information. I am trying to understand JOINS and I am not sure why I am getting this output: MANUFACTURE MODEL …