Solved

Problem with simple sql and sqlcompact database

Posted on 2014-10-09
3
74 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 50

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 50

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

739 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