House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  SQL

at sign in sql select statement

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Dinowitz
06/13/2011 01:09 PM

I'm looking at a query in someones code and it has something that is unfamiliar to me. The select statement has: FROM dbo.Person@Reliance What is the @ sign? Neither Person nor Reliance are tables in the database. Also, there is an Order By that just has numbers, no fields to sort by: ORDER BY 8,9,6 Can anyone educate me on this? Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Boughton
06/13/2011 01:19 PM

Never seen @ in a table name either, dunno what that might mean. However, the numbers in ORDER BY relate to the columns in the SELECT part:     SELECT id,name,email     ...     ORDER BY 3,2 ...is equivalent to...     SELECT id,name,email     ...     ORDER BY email,name You can also use numbers in GROUP BY in the same way. Useful when you want to avoid repeating a bunch of column names ... though less helpful when you've got nine (or more) columns and you're ordering like they are in your example.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
George Gallen
06/13/2011 02:01 PM

just a guess, but could @name be a machine name? saying the table is on machine reliant? George ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Maureen
06/13/2011 02:20 PM

@tablename is a table variable in SQL Server but it usually has to be declared before being used. What database are you using? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrian J. Moreno
06/13/2011 02:27 PM

The numbers in the ORDER statement are the cardinal positions of the columns in the SELECT statement required for ORDER. Have you checked if there is a View named "Person@Reliance"? Adrian J. Moreno I Know Kung Foo Consulting (214) 280-6676 http://iknowkungfoo.com http://twitter.com/iknowkungfoo Sent from my iPad On Jun 13, 2011, at 12:08 PM, Michael Dinowitz <mdinowit@houseoffusion.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Perez, Percy
06/13/2011 02:24 PM

Maureen <mamamaureen@gmail.com> wrote: @tablename is a table variable in SQL Server but it usually has to be declared before being used. What database are you using? ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search sql

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference