Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

SQL Question

  • 23-06-2005 9:29am
    #1
    Closed Accounts Posts: 166 ✭✭


    Does anyone know what *= in SQL is used for?
    An example of its use would be:

    select name, age, d.address
    from Details d, names n
    where n.age *= d.age

    Im thinking its the same as the LIKE operator except for use with numeric data.
    Anyone know??


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Would it be the same as...

    n.age = n.age * d.age

    dunno


  • Closed Accounts Posts: 166 ✭✭bragan


    maybe. im not to sure. i don't think there trying to multipy in the statement though


  • Registered Users, Registered Users 2 Posts: 44,195 ✭✭✭✭Basq


    Am presuming * is the wildcard character in that statement.


  • Closed Accounts Posts: 166 ✭✭bragan


    yeah, so by doing wildcard equals its saying
    if n.age is like or equal d.age ??


  • Registered Users, Registered Users 2 Posts: 4,963 ✭✭✭long_b


    It's a type of Join ...

    "Transact-SQL Joins
    In earlier versions of Microsoft® SQL Server™ 2000, left and right outer join conditions were specified in the WHERE clause using the *= and =* operators. In some cases, this syntax results in an ambiguous query that can be interpreted in more than one way. SQL-92 compliant outer joins are specified in the FROM clause and do not result in this ambiguity. Because the SQL-92 syntax is more precise, detailed information about using the old Transact-SQL outer join syntax in the WHERE clause is not included with this release. The syntax may not be supported in a future version of SQL Server. Any statements using the Transact-SQL outer joins should be changed to use the SQL-92 syntax.

    The SQL-92 standard does support the specification of inner joins in either the FROM or WHERE clause. Inner joins specified in the WHERE clause do not have the same problems with ambiguity as the Transact-SQL outer join syntax."


  • Advertisement
  • Closed Accounts Posts: 166 ✭✭bragan


    ok, thanks


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    as mentioned *= and =* are hang overs from MS SQL 7 and prior versions.
    Bad habit you shoould rewrite the code
    if you find any
    A:
    Select
    MyName = FirstNAme
    From Customers
    then you should really rewrite
    as
    B:
    Select
    FirstNAme AS MyName
    From Customers

    as again A: is a MS thingy and not ANSI compliant


Advertisement