Solved

Problem with simple sql and sqlcompact database

Posted on 2014-10-09
3
70 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 46

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 46

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

863 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

18 Experts available now in Live!

Get 1:1 Help Now