Solved

Problem with simple sql and sqlcompact database

Posted on 2014-10-09
3
68 Views
Last Modified: 2014-12-09
Hi.

This sql, makes an sql error.
 "select a.navn, (select count(navn) from produkt) as counter from produkt as a "
It dosent seem to work with my sdf database in webmatrix.
Is it possible that select in select is not supportet?
0
Comment
Question by:bongii
  • 2
3 Comments
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40370712
What are you trying to do and what's the error message?
Maybe this alternative query is what you are looking for?
select navn, count(navn) as counter 
from product
group by navn

Open in new window

0
 

Author Comment

by:bongii
ID: 40370940
It´s just an example. The select in select is an other table off couse.

System.Data.SqlServerCe.SqlCeException: There was an error parsing the query


 "select a.navn, (select count(navn) from pictures) as counter from produkt as a "
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40370957
Can't you post the real query?
That error means you have something written that MSSQL doesn't understand. Maybe some column or table name with space (then you need to use brackets to enclose the column/table name) or you are using some reserved word as column or table name.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now