Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Venk
Starting Member
6 Posts |
Posted - 2013-11-16 : 16:50:28
|
HiWorking on a query to display books and the authors who wrote them. The following query gives an error message. Can anyone help? - thanksCreate View AuthorBooks As SELECT Title, AuthorFROM BooksWhere Category = 'Author'; |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-11-16 : 23:03:31
|
What's the error? I don't see a problem with that code.Be One with the OptimizerTG |
|
|
Venk
Starting Member
6 Posts |
Posted - 2013-11-17 : 01:04:31
|
quote: Originally posted by TG What's the error? I don't see a problem with that code.Be One with the OptimizerTG
It says invalid identifier |
|
|
Venk
Starting Member
6 Posts |
Posted - 2013-11-17 : 01:05:14
|
quote: Originally posted by TG What's the error? I don't see a problem with that code.Be One with the OptimizerTG
I mean it says "Author" invalid identifier |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-11-17 : 01:10:05
|
are you using Microsoft SQL Server ? KH[spoiler]Time is always against us[/spoiler] |
|
|
Venk
Starting Member
6 Posts |
Posted - 2013-11-17 : 01:57:45
|
quote: Originally posted by khtan are you using Microsoft SQL Server ? KH[spoiler]Time is always against us[/spoiler]
Yes, but when i use Read Only instead of Author I do not get any error message |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-11-17 : 02:48:36
|
what do you mean "use Read Only" ? KH[spoiler]Time is always against us[/spoiler] |
|
|
Venk
Starting Member
6 Posts |
Posted - 2013-11-17 : 02:52:14
|
quote: Originally posted by khtan what do you mean "use Read Only" ? KH[spoiler]Time is always against us[/spoiler]
Using With Read Only; instead of Where Category = 'Author'; at the end of the syntax |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-11-17 : 08:55:12
|
can you show us the "read only" code ?Also can you post your table DDL, some sample data ? KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|