Click here to Skip to main content
15,913,773 members
Home / Discussions / Database
   

Database

 
AnswerRe: syntax in interger and string in SQL Pin
albCode9-Jun-06 2:17
albCode9-Jun-06 2:17 
GeneralRe: syntax in interger and string in SQL Pin
angelagke10-Jun-06 7:56
angelagke10-Jun-06 7:56 
AnswerRe: syntax in interger and string in SQL Pin
Eric Dahlvang9-Jun-06 3:24
Eric Dahlvang9-Jun-06 3:24 
GeneralRe: syntax in interger and string in SQL Pin
angelagke10-Jun-06 7:58
angelagke10-Jun-06 7:58 
Questionchange the predicate to use "CASE" Pin
angelagke9-Jun-06 1:31
angelagke9-Jun-06 1:31 
AnswerRe: change the predicate to use "CASE" Pin
Frank Kerrigan9-Jun-06 2:33
Frank Kerrigan9-Jun-06 2:33 
GeneralRe: change the predicate to use "CASE" Pin
angelagke10-Jun-06 7:42
angelagke10-Jun-06 7:42 
AnswerRe: change the predicate to use "CASE" Pin
Eric Dahlvang9-Jun-06 3:40
Eric Dahlvang9-Jun-06 3:40 
CASE is generally used in instances where you want a different field value returned based on specified conditions. Your select statement is only concerned with returning all fields based on certain conditions. In other words, CASE wouldn't be used in the WHERE clause of an sql statement such as yours.

You could clean this up a little though, like this:
select title, price, Name = substring (au_lname, 1,40), type<br />
from authors a inner join titleauthor ta on a.au_id = ta.au_id inner join titles t on ta.title_id = t.title_id<br />
where  au_lname = @au_lname OR isnull(au_lname,'') = ''


Or your where clause could be like this:
where isnull(au_lname,'') IN (@au_lname,'')


Other than that, nothing comes to my mind.

----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: change the predicate to use "CASE" Pin
angelagke10-Jun-06 7:50
angelagke10-Jun-06 7:50 
GeneralRe: change the predicate to use "CASE" Pin
angelagke12-Jun-06 17:56
angelagke12-Jun-06 17:56 
GeneralRe: change the predicate to use "CASE" Pin
Eric Dahlvang13-Jun-06 3:12
Eric Dahlvang13-Jun-06 3:12 
QuestionHow to write store procedure ? Pin
SaravuthYos8-Jun-06 22:00
SaravuthYos8-Jun-06 22:00 
AnswerRe: How to write store procedure ? Pin
Colin Angus Mackay9-Jun-06 0:02
Colin Angus Mackay9-Jun-06 0:02 
AnswerRe: How to write store procedure ? Pin
Frank Kerrigan9-Jun-06 0:59
Frank Kerrigan9-Jun-06 0:59 
AnswerRe: How to write store procedure ? Pin
Rakesh.Jha.011010-Jun-06 0:13
Rakesh.Jha.011010-Jun-06 0:13 
QuestionSimple Database access Pin
Andrew Stampor8-Jun-06 17:35
Andrew Stampor8-Jun-06 17:35 
AnswerRe: Simple Database access Pin
Colin Angus Mackay8-Jun-06 20:08
Colin Angus Mackay8-Jun-06 20:08 
GeneralRe: Simple Database access Pin
Andrew Stampor11-Jun-06 8:47
Andrew Stampor11-Jun-06 8:47 
GeneralRe: Simple Database access [modified] Pin
Colin Angus Mackay11-Jun-06 11:16
Colin Angus Mackay11-Jun-06 11:16 
QuestionHelp with Navigation in Reporting Services Pin
spirit_kleptus8-Jun-06 12:50
spirit_kleptus8-Jun-06 12:50 
QuestionDynamic SQL - Not Returning Unicode Pin
Tristan Rhodes8-Jun-06 6:56
Tristan Rhodes8-Jun-06 6:56 
QuestionSyntax question: Multiple Inner Joins Pin
leckey8-Jun-06 6:04
leckey8-Jun-06 6:04 
AnswerRe: Syntax question: Multiple Inner Joins Pin
Kschuler8-Jun-06 6:29
Kschuler8-Jun-06 6:29 
GeneralRe: Syntax question: Multiple Inner Joins Pin
leckey8-Jun-06 6:38
leckey8-Jun-06 6:38 
GeneralRe: Syntax question: Multiple Inner Joins Pin
Kschuler8-Jun-06 6:42
Kschuler8-Jun-06 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.